WordPress Landing Pages - Version 2.6.1

Version Description

  • Ensuring Google UTM parameters are not removed from Landing Page URL
  • Responsive design improvements to Simple Two Column Responsive landing page.
Download this release

Release Info

Developer adbox
Plugin Icon 128x128 WordPress Landing Pages
Version 2.6.1
Comparing to
See all releases

Code changes from version 2.5.9 to 2.6.1

assets/css/admin/edit-landing-page.css CHANGED
@@ -1,108 +1,167 @@
1
  #main-title-area #lp-main-headline {
2
- width: 100%;
3
- font-size: 23px;
4
- outline: 0 none;
5
- padding: 0px 7px;
6
  }
 
7
  #post-body-content, .edit-form-section {
8
- margin-bottom: 0px;
9
  }
10
 
11
  #main-title-header h3 {
12
- display: inline-block;
13
- padding-left: 0px;
14
  }
 
15
  #titlediv {
16
- margin-bottom: 0px;
17
  }
 
18
  #TB_window {
19
- z-index: 999999999999;
20
- }
21
- .currently_selected{
22
- position: absolute;
23
- top: 72px;
24
- left: 16px;
25
- font-size: 19px;
26
- line-height: 21px;
27
- padding-top: 15px;
28
- text-align: center;
29
- background: black;
30
- width: 90%;
31
- height: 36px;
32
- color: white;
33
- opacity: 0.5;
34
- border-radius: 7px;
 
35
  }
 
36
  .lp-template-selector-container ul#template-filter li {
37
- display: inline-block;
38
 
39
- margin-right: 5px;
40
- text-align: center;
41
- margin-bottom: 10px;
42
  }
 
43
  .lp-template-selector-container ul#template-filter {
44
- margin-bottom: 10px;
45
  }
 
46
  .lp-template-selector-container ul#template-filter {
47
- line-height: 30px;
48
- margin-top: 10px;
49
- margin-bottom: 0px;
50
  }
 
51
  .lp-template-selector-container ul#template-filter a {
52
- margin-right: 0px;
53
- padding: 0px;
54
- font-weight: bold;
55
- text-decoration: none;
56
  }
 
57
  ul#template-filter .button-primary a {
58
- color:#fff;
59
  }
 
60
  #more-templates-button {
61
- display: inline-block;
62
- vertical-align: middle;
63
- float: none !important;
64
- font-weight: normal;
65
- font-size: 20px;
66
  }
 
67
  #more-templates-button a {
68
- font-size: 15px;
69
  }
70
- #lp_2_form_content {
71
- margin-top:20px;
 
72
  }
 
73
  #lp_2_form_content .hndle em {
74
- font-size: 13px;
75
- }
76
- .template-thumbnail
77
- {
78
- width:100%;
79
- height:190px;
80
- -webkit-border-radius: 4px;
81
- -khtml-border-radius: 4px;
82
- -moz-border-radius: 4px;
83
- border-radius: 4px;
84
- background-color: #A9A9A9;
85
- -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
86
- -moz-box-shadow: rgba(0,0,0,0.2) 0 0 0 1px,rgba(0,0,0,0.3) 0 2px 5px;
87
- box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px,rgba(0, 0, 0, 0.3) 0 2px 5px;
88
- }
89
-
90
- ul#template-filter{ margin: 0px 0; padding: 0; padding-left: 0px; line-height: 64px; }
91
- ul#template-filter li{ display: inline; }
92
- ul#template-filter a{ margin-right: 0.5em; padding: 0em 1em; font-weight: bold; text-decoration: none; }
93
- ul#template-filter .button-primary a:hover { color:#fff;}
94
- ul#template-filter a.current{ background-color: #DDD; }
95
-
96
- #template-item{ float: left; margin-right: 18px; overflow: hidden; margin: 0px 0 0 0; padding: 0; list-style: none; width: 300px; margin-bottom: 10px; }
97
- #template-item div{ display: block; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /* #template-item div a{ display: block; width: 163px; height: 120px; overflow: hidden; border: 1px solid #CDCDCD; background: #eee; }*/
99
- #template-item li p{ font-size: 11px; line-height: 15px; color: #AAA; margin: 5px 0; }
100
- #template-box .lp_tooltip_templates{
101
- bottom: 6px;
 
 
 
 
 
 
102
  position: absolute;
103
  right: 8px;
104
  }
105
 
106
  .lp_tooltip {
107
- display:inline;
 
 
 
 
 
 
 
108
  }
1
  #main-title-area #lp-main-headline {
2
+ width: 100%;
3
+ font-size: 23px;
4
+ outline: 0 none;
5
+ padding: 0px 7px;
6
  }
7
+
8
  #post-body-content, .edit-form-section {
9
+ margin-bottom: 0px;
10
  }
11
 
12
  #main-title-header h3 {
13
+ display: inline-block;
14
+ padding-left: 0px;
15
  }
16
+
17
  #titlediv {
18
+ margin-bottom: 0px;
19
  }
20
+
21
  #TB_window {
22
+ z-index: 999999999999;
23
+ }
24
+
25
+ .currently_selected {
26
+ position: absolute;
27
+ top: 72px;
28
+ left: 16px;
29
+ font-size: 19px;
30
+ line-height: 21px;
31
+ padding-top: 15px;
32
+ text-align: center;
33
+ background: black;
34
+ width: 90%;
35
+ height: 36px;
36
+ color: white;
37
+ opacity: 0.5;
38
+ border-radius: 7px;
39
  }
40
+
41
  .lp-template-selector-container ul#template-filter li {
42
+ display: inline-block;
43
 
44
+ margin-right: 5px;
45
+ text-align: center;
46
+ margin-bottom: 10px;
47
  }
48
+
49
  .lp-template-selector-container ul#template-filter {
50
+ margin-bottom: 10px;
51
  }
52
+
53
  .lp-template-selector-container ul#template-filter {
54
+ line-height: 30px;
55
+ margin-top: 10px;
56
+ margin-bottom: 0px;
57
  }
58
+
59
  .lp-template-selector-container ul#template-filter a {
60
+ margin-right: 0px;
61
+ padding: 0px;
62
+ font-weight: bold;
63
+ text-decoration: none;
64
  }
65
+
66
  ul#template-filter .button-primary a {
67
+ color: #fff;
68
  }
69
+
70
  #more-templates-button {
71
+ display: inline-block;
72
+ vertical-align: middle;
73
+ float: none !important;
74
+ font-weight: normal;
75
+ font-size: 20px;
76
  }
77
+
78
  #more-templates-button a {
79
+ font-size: 15px;
80
  }
81
+
82
+ #lp_2_form_content {
83
+ margin-top: 20px;
84
  }
85
+
86
  #lp_2_form_content .hndle em {
87
+ font-size: 13px;
88
+ }
89
+
90
+ .template-thumbnail {
91
+ width: 100%;
92
+ height: 190px;
93
+ -webkit-border-radius: 4px;
94
+ -khtml-border-radius: 4px;
95
+ -moz-border-radius: 4px;
96
+ border-radius: 4px;
97
+ background-color: #A9A9A9;
98
+ -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 2px 5px;
99
+ -moz-box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 2px 5px;
100
+ box-shadow: rgba(0, 0, 0, 0.2) 0 0 0 1px, rgba(0, 0, 0, 0.3) 0 2px 5px;
101
+ }
102
+
103
+ ul#template-filter {
104
+ margin: 0px 0;
105
+ padding: 0;
106
+ padding-left: 0px;
107
+ line-height: 64px;
108
+ }
109
+
110
+ ul#template-filter li {
111
+ display: inline;
112
+ }
113
+
114
+ ul#template-filter a {
115
+ margin-right: 0.5em;
116
+ padding: 0em 1em;
117
+ font-weight: bold;
118
+ text-decoration: none;
119
+ }
120
+
121
+ ul#template-filter .button-primary a:hover {
122
+ color: #fff;
123
+ }
124
+
125
+ ul#template-filter a.current {
126
+ background-color: #DDD;
127
+ }
128
+
129
+ #template-item {
130
+ float: left;
131
+ margin-right: 18px;
132
+ overflow: hidden;
133
+ margin: 0px 0 0 0;
134
+ padding: 0;
135
+ list-style: none;
136
+ width: 300px;
137
+ margin-bottom: 10px;
138
+ }
139
+
140
+ #template-item div {
141
+ display: block;
142
+ }
143
+
144
  /* #template-item div a{ display: block; width: 163px; height: 120px; overflow: hidden; border: 1px solid #CDCDCD; background: #eee; }*/
145
+ #template-item li p {
146
+ font-size: 11px;
147
+ line-height: 15px;
148
+ color: #AAA;
149
+ margin: 5px 0;
150
+ }
151
+
152
+ #template-box .lp_tooltip_templates {
153
+ bottom: 6px;
154
  position: absolute;
155
  right: 8px;
156
  }
157
 
158
  .lp_tooltip {
159
+ display: inline;
160
+ }
161
+
162
+ .lp_tooltip:after {
163
+ font-family: "fontawesome";
164
+ content: "\f05a";
165
+ padding-left: 10px;
166
+ opacity: .3;
167
  }
classes/class.metaboxes.php CHANGED
@@ -805,7 +805,7 @@ href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo
805
 
806
  $cats = explode(',', $data['info']['category']);
807
  foreach ($cats as $key => $cat) {
808
- $cat = trim($cat);
809
  $cat = str_replace(' ', '-', $cat);
810
  $cats[$key] = trim(strtolower($cat));
811
  }
@@ -1054,7 +1054,7 @@ href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo
1054
  break;
1055
  case 'number':
1056
 
1057
- echo '<input type="number" class="' . $option_class . '" name="' . $field_id . '" id="' . $field_id . '" value="' . $meta . '" size="30" />
1058
  <div class="lp_tooltip" title="' . $field['description'] . '"></div>';
1059
 
1060
  break;
@@ -1171,7 +1171,6 @@ href='?post=<?php echo $post->ID; ?>&action=edit&action-variation-id=<?php echo
1171
  }
1172
  Landing_Pages_Variations::update_variations( $landing_page_id , $variations );
1173
 
1174
-
1175
  /* save all post data */
1176
  $ignore_list = array( 'acf' , 'post_status', 'post_type', 'tax_input', 'post_author', 'user_ID', 'post_ID', 'landing-page-myeditor', 'catslist', 'post_title', 'samplepermalinknonce', 'autosavenonce', 'action', 'autosave', 'mm', 'jj', 'aa', 'hh', 'mn', 'ss', '_wp_http_referer', 'lp-variation-id', '_wpnonce', 'originalaction', 'original_post_status', 'referredby', '_wp_original_http_referer', 'meta-box-order-nonce', 'closedpostboxesnonce', 'hidden_post_status', 'hidden_post_password', 'hidden_post_visibility', 'visibility', 'post_password', 'hidden_mm', 'cur_mm', 'hidden_jj', 'cur_jj', 'hidden_aa', 'cur_aa', 'hidden_hh', 'cur_hh', 'hidden_mn', 'cur_mn', 'original_publish', 'save', 'newlanding_page_category', 'newlanding_page_category_parent', '_ajax_nonce-add-landing_page_category', 'lp_lp_custom_fields_nonce', 'post_mime_type', 'ID', 'comment_status', 'ping_status');
1177
  foreach ($_REQUEST as $key => $value) {
805
 
806
  $cats = explode(',', $data['info']['category']);
807
  foreach ($cats as $key => $cat) {
808
+ $cat = ($cat) ? trim($cat) : '';
809
  $cat = str_replace(' ', '-', $cat);
810
  $cats[$key] = trim(strtolower($cat));
811
  }
1054
  break;
1055
  case 'number':
1056
 
1057
+ echo '<input type="number" class="' . $option_class . '" name="' . $field_id . '" id="' . $field_id . '" value="' . $meta . '" size="20" ' . (isset($field['min']) ? 'min="'.$field['min'].'"' : '' ) . ' ' . (isset($field['max']) ? 'max="'.$field['max'].'"' : '' ) . ' ' . (isset($field['step']) ? 'step="'.$field['step'].'"' : '' ) . '/>
1058
  <div class="lp_tooltip" title="' . $field['description'] . '"></div>';
1059
 
1060
  break;
1171
  }
1172
  Landing_Pages_Variations::update_variations( $landing_page_id , $variations );
1173
 
 
1174
  /* save all post data */
1175
  $ignore_list = array( 'acf' , 'post_status', 'post_type', 'tax_input', 'post_author', 'user_ID', 'post_ID', 'landing-page-myeditor', 'catslist', 'post_title', 'samplepermalinknonce', 'autosavenonce', 'action', 'autosave', 'mm', 'jj', 'aa', 'hh', 'mn', 'ss', '_wp_http_referer', 'lp-variation-id', '_wpnonce', 'originalaction', 'original_post_status', 'referredby', '_wp_original_http_referer', 'meta-box-order-nonce', 'closedpostboxesnonce', 'hidden_post_status', 'hidden_post_password', 'hidden_post_visibility', 'visibility', 'post_password', 'hidden_mm', 'cur_mm', 'hidden_jj', 'cur_jj', 'hidden_aa', 'cur_aa', 'hidden_hh', 'cur_hh', 'hidden_mn', 'cur_mn', 'original_publish', 'save', 'newlanding_page_category', 'newlanding_page_category_parent', '_ajax_nonce-add-landing_page_category', 'lp_lp_custom_fields_nonce', 'post_mime_type', 'ID', 'comment_status', 'ping_status');
1176
  foreach ($_REQUEST as $key => $value) {
classes/class.post-type.landing-page.php CHANGED
@@ -631,7 +631,29 @@ class Landing_Pages_Post_Type {
631
  /* Then strip params if pushstate exists */
632
  if (typeof window.history.pushState == 'function') {
633
  var cleanparams=window.location.href.split("?");
634
- var clean_url=cleanparams[0];history.replaceState({},"landing page",clean_url);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
635
  }
636
  </script>
637
  <?php
631
  /* Then strip params if pushstate exists */
632
  if (typeof window.history.pushState == 'function') {
633
  var cleanparams=window.location.href.split("?");
634
+ var clean_url= landing_pages_remove_variation_param();
635
+ history.replaceState({},"landing page",clean_url);
636
+ }
637
+ function landing_pages_remove_variation_param() {
638
+ var urlparts= window.location.href.split('?');
639
+ if (urlparts.length>=2) {
640
+
641
+ var prefix= encodeURIComponent('lp-variation-id')+'=';
642
+ var pars= urlparts[1].split(/[&;]/g);
643
+
644
+ /* reverse iteration as may be destructive */
645
+ for (var i= pars.length; i-- > 0;) {
646
+ //idiom for string.startsWith
647
+ if (pars[i].lastIndexOf(prefix, 0) !== -1) {
648
+ pars.splice(i, 1);
649
+ }
650
+ }
651
+
652
+ url= urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : "");
653
+ return url;
654
+ } else {
655
+ return url;
656
+ }
657
  }
658
  </script>
659
  <?php
classes/class.statistics.php CHANGED
@@ -83,7 +83,6 @@ class Landing_Pages_Stats {
83
  return $data;
84
  }
85
 
86
-
87
  /* increment conversions for landing pages */
88
  if( isset($data['post_type']) && $data['post_type'] === 'landing-page' ) {
89
  $conversions = Landing_Pages_Variations::get_conversions( $data['page_id'] , $data['variation'] );
83
  return $data;
84
  }
85
 
 
86
  /* increment conversions for landing pages */
87
  if( isset($data['post_type']) && $data['post_type'] === 'landing-page' ) {
88
  $conversions = Landing_Pages_Variations::get_conversions( $data['page_id'] , $data['variation'] );
landing-pages.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
- Version: 2.5.9
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
@@ -41,7 +41,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
41
  */
42
  private static function load_constants() {
43
 
44
- define('LANDINGPAGES_CURRENT_VERSION', '2.5.9' );
45
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
46
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
47
  define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
3
  Plugin Name: Landing Pages
4
  Plugin URI: http://www.inboundnow.com/landing-pages/
5
  Description: Landing page template framework with variant testing and lead capturing through cooperation with Inbound Now's Leads plugin. This is the stand alone version served through WordPress.org.
6
+ Version: 2.6.1
7
  Author: Inbound Now
8
  Author URI: http://www.inboundnow.com/
9
 
41
  */
42
  private static function load_constants() {
43
 
44
+ define('LANDINGPAGES_CURRENT_VERSION', '2.6.1' );
45
  define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
46
  define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
47
  define('LANDINGPAGES_PLUGIN_SLUG', 'landing-pages' );
readme.txt CHANGED
@@ -6,8 +6,8 @@ License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
- Tested up to: 4.8
10
- Stable Tag: 2.5.9
11
 
12
 
13
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
@@ -85,6 +85,10 @@ We also offer a guide for using <a href="https://github.com/inboundnow/landing-p
85
 
86
  == Changelog ==
87
 
 
 
 
 
88
  = 2.5.9 =
89
  * Disabling search and comment tracking when Leads component not available.
90
 
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
8
  Requires at least: 3.8
9
+ Tested up to: 4.8.1
10
+ Stable Tag: 2.6.1
11
 
12
 
13
  Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
85
 
86
  == Changelog ==
87
 
88
+ = 2.6.1 =
89
+ * Ensuring Google UTM parameters are not removed from Landing Page URL
90
+ * Responsive design improvements to Simple Two Column Responsive landing page.
91
+
92
  = 2.5.9 =
93
  * Disabling search and comment tracking when Leads component not available.
94
 
shared/assets/js/frontend/analytics-src/analytics.lead.js CHANGED
@@ -1,88 +1,88 @@
1
- /**
2
- * Leads API functions
3
- * @param Object _inbound - Main JS object
4
- * @return Object - include event triggers
5
- */
6
- var _inboundLeadsAPI = (function(_inbound) {
7
- var httpRequest;
8
- _inbound.LeadsAPI = {
9
- init: function() {
10
-
11
- var utils = _inbound.Utils,
12
- wp_lead_uid = utils.readCookie("wp_lead_uid"),
13
- wp_lead_id = utils.readCookie("wp_lead_id"),
14
- expire_check = utils.readCookie("lead_data_expire");
15
-
16
- if (!expire_check) {
17
- _inbound.deBugger('leads', 'expired vistor. Run Processes');
18
- //var data_to_lookup = global-localized-vars;
19
- if (wp_lead_id) {
20
- /* Get InboundLeadData */
21
- _inbound.LeadsAPI.getAllLeadData();
22
- }
23
- }
24
- },
25
- setGlobalLeadData: function(data) {
26
- InboundLeadData = data;
27
- },
28
- getAllLeadData: function(expire_check) {
29
- var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id"),
30
- leadData = _inbound.totalStorage('inbound_lead_data'),
31
- leadDataExpire = _inbound.Utils.readCookie("lead_data_expire");
32
- data = {
33
- action: 'inbound_get_all_lead_data',
34
- wp_lead_id: wp_lead_id
35
- },
36
- success = function(returnData) {
37
- var leadData = JSON.parse(returnData);
38
- _inbound.LeadsAPI.setGlobalLeadData(leadData);
39
- _inbound.totalStorage('inbound_lead_data', leadData); // store lead data
40
-
41
- /* Set 3 day timeout for checking DB for new lead data for Lead_Global var */
42
- var d = new Date();
43
- d.setTime(d.getTime() + 30 * 60 * 1000);
44
- var expire = _inbound.Utils.addDays(d, 3);
45
- _inbound.Utils.createCookie("lead_data_expire", true, expire);
46
-
47
- };
48
-
49
- if (!leadData) {
50
- // Get New Lead Data from DB
51
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
52
-
53
- } else {
54
- // set global lead var with localstorage data
55
- _inbound.LeadsAPI.setGlobalLeadData(leadData);
56
- _inbound.deBugger('lead', 'Set Global Lead Data from Localstorage');
57
-
58
- if (!leadDataExpire) {
59
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
60
- //console.log('Set Global Lead Data from Localstorage');
61
- _inbound.deBugger('lead', 'localized data old. Pull new from DB');
62
- //console.log('localized data old. Pull new from DB');
63
- }
64
- }
65
-
66
- },
67
- getLeadLists: function() {
68
- var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id");
69
- var data = {
70
- action: 'wpl_check_lists',
71
- wp_lead_id: wp_lead_id
72
- };
73
- var success = function(user_id) {
74
- _inbound.Utils.createCookie("lead_session_list_check", true, {
75
- path: '/',
76
- expires: 1
77
- });
78
- _inbound.deBugger('lead', "Lists checked");
79
- //console.log("Lists checked");
80
- };
81
- //_inbound.Utils.doAjax(data, success);
82
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
83
- }
84
- };
85
-
86
- return _inbound;
87
-
88
  })(_inbound || {});
1
+ /**
2
+ * Leads API functions
3
+ * @param Object _inbound - Main JS object
4
+ * @return Object - include event triggers
5
+ */
6
+ var _inboundLeadsAPI = (function(_inbound) {
7
+ var httpRequest;
8
+ _inbound.LeadsAPI = {
9
+ init: function() {
10
+
11
+ var utils = _inbound.Utils,
12
+ wp_lead_uid = utils.readCookie("wp_lead_uid"),
13
+ wp_lead_id = utils.readCookie("wp_lead_id"),
14
+ expire_check = utils.readCookie("lead_data_expire");
15
+
16
+ if (!expire_check) {
17
+ _inbound.deBugger('leads', 'expired vistor. Run Processes');
18
+ //var data_to_lookup = global-localized-vars;
19
+ if (wp_lead_id) {
20
+ /* Get InboundLeadData */
21
+ _inbound.LeadsAPI.getAllLeadData();
22
+ }
23
+ }
24
+ },
25
+ setGlobalLeadData: function(data) {
26
+ InboundLeadData = data;
27
+ },
28
+ getAllLeadData: function(expire_check) {
29
+ var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id"),
30
+ leadData = _inbound.totalStorage('inbound_lead_data'),
31
+ leadDataExpire = _inbound.Utils.readCookie("lead_data_expire");
32
+ data = {
33
+ action: 'inbound_get_all_lead_data',
34
+ wp_lead_id: wp_lead_id
35
+ },
36
+ success = function(returnData) {
37
+ var leadData = JSON.parse(returnData);
38
+ _inbound.LeadsAPI.setGlobalLeadData(leadData);
39
+ _inbound.totalStorage('inbound_lead_data', leadData); // store lead data
40
+
41
+ /* Set 3 day timeout for checking DB for new lead data for Lead_Global var */
42
+ var d = new Date();
43
+ d.setTime(d.getTime() + 30 * 60 * 1000);
44
+ var expire = _inbound.Utils.addDays(d, 3);
45
+ _inbound.Utils.createCookie("lead_data_expire", true, expire);
46
+
47
+ };
48
+
49
+ if (!leadData) {
50
+ // Get New Lead Data from DB
51
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
52
+
53
+ } else {
54
+ // set global lead var with localstorage data
55
+ _inbound.LeadsAPI.setGlobalLeadData(leadData);
56
+ _inbound.deBugger('lead', 'Set Global Lead Data from Localstorage');
57
+
58
+ if (!leadDataExpire) {
59
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
60
+ //console.log('Set Global Lead Data from Localstorage');
61
+ _inbound.deBugger('lead', 'localized data old. Pull new from DB');
62
+ //console.log('localized data old. Pull new from DB');
63
+ }
64
+ }
65
+
66
+ },
67
+ getLeadLists: function() {
68
+ var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id");
69
+ var data = {
70
+ action: 'wpl_check_lists',
71
+ wp_lead_id: wp_lead_id
72
+ };
73
+ var success = function(user_id) {
74
+ _inbound.Utils.createCookie("lead_session_list_check", true, {
75
+ path: '/',
76
+ expires: 1
77
+ });
78
+ _inbound.deBugger('lead', "Lists checked");
79
+ //console.log("Lists checked");
80
+ };
81
+ //_inbound.Utils.doAjax(data, success);
82
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
83
+ }
84
+ };
85
+
86
+ return _inbound;
87
+
88
  })(_inbound || {});
shared/assets/js/frontend/analytics/inboundAnalytics.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
  /**
3
  * # _inbound
4
  *
@@ -129,7 +129,7 @@ var _inbound = (function(options) {
129
 
130
  return Analytics;
131
 
132
- })(_inboundOptions);
133
  /**
134
  * # Hooks & Filters
135
  *
@@ -534,7 +534,7 @@ var _inboundHooks = (function (_inbound) {
534
 
535
  return _inbound;
536
 
537
- })(_inbound || {});
538
  /**
539
  * # _inbound UTILS
540
  *
@@ -1393,7 +1393,7 @@ var _inboundUtils = (function(_inbound) {
1393
  return _inbound;
1394
 
1395
  })(_inbound || {});
1396
-
1397
  /**
1398
  * # Inbound Forms
1399
  *
@@ -2601,7 +2601,7 @@ var InboundForms = (function(_inbound) {
2601
  return _inbound;
2602
 
2603
  })(_inbound || {});
2604
-
2605
  /**
2606
  * # Analytics Events
2607
  *
@@ -3211,228 +3211,228 @@ function inboundFormNoRedirectContent(){
3211
  }
3212
 
3213
  _inbound.add_action( 'form_after_submission', inboundFormNoRedirectContent, 10 );
3214
-
3215
- /* LocalStorage Component */
3216
- var InboundTotalStorage = (function (_inbound){
3217
-
3218
- var supported, ls, mod = '_inbound';
3219
- if ('localStorage' in window){
3220
- try {
3221
- ls = (typeof window.localStorage === 'undefined') ? undefined : window.localStorage;
3222
- if (typeof ls == 'undefined' || typeof window.JSON == 'undefined'){
3223
- supported = false;
3224
- } else {
3225
- supported = true;
3226
- }
3227
- window.localStorage.setItem(mod, '1');
3228
- window.localStorage.removeItem(mod);
3229
- }
3230
- catch (err){
3231
- supported = false;
3232
- }
3233
- }
3234
-
3235
- /* Make the methods public */
3236
- _inbound.totalStorage = function(key, value, options){
3237
- return _inbound.totalStorage.impl.init(key, value);
3238
- };
3239
-
3240
- _inbound.totalStorage.setItem = function(key, value){
3241
- return _inbound.totalStorage.impl.setItem(key, value);
3242
- };
3243
-
3244
- _inbound.totalStorage.getItem = function(key){
3245
- return _inbound.totalStorage.impl.getItem(key);
3246
- };
3247
-
3248
- _inbound.totalStorage.getAll = function(){
3249
- return _inbound.totalStorage.impl.getAll();
3250
- };
3251
-
3252
- _inbound.totalStorage.deleteItem = function(key){
3253
- return _inbound.totalStorage.impl.deleteItem(key);
3254
- };
3255
-
3256
-
3257
- _inbound.totalStorage.impl = {
3258
-
3259
- init: function(key, value){
3260
- if (typeof value != 'undefined') {
3261
- return this.setItem(key, value);
3262
- } else {
3263
- return this.getItem(key);
3264
- }
3265
- },
3266
-
3267
- setItem: function(key, value){
3268
- if (!supported){
3269
- try {
3270
- _inbound.Utils.createCookie(key, value);
3271
- return value;
3272
- } catch(e){
3273
- console.log('Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie');
3274
- }
3275
- }
3276
- var saver = JSON.stringify(value);
3277
- ls.setItem(key, saver);
3278
- return this.parseResult(saver);
3279
- },
3280
- getItem: function(key){
3281
- if (!supported){
3282
- try {
3283
- return this.parseResult(_inbound.Utils.readCookie(key));
3284
- } catch(e){
3285
- return null;
3286
- }
3287
- }
3288
- var item = ls.getItem(key);
3289
- return this.parseResult(item);
3290
- },
3291
- deleteItem: function(key){
3292
- if (!supported){
3293
- try {
3294
- _inbound.Utils.eraseCookie(key, null);
3295
- return true;
3296
- } catch(e){
3297
- return false;
3298
- }
3299
- }
3300
- ls.removeItem(key);
3301
- return true;
3302
- },
3303
- getAll: function(){
3304
- var items = [];
3305
- if (!supported){
3306
- try {
3307
- var pairs = document.cookie.split(";");
3308
- for (var i = 0; i<pairs.length; i++){
3309
- var pair = pairs[i].split('=');
3310
- var key = pair[0];
3311
- items.push({key:key, value:this.parseResult(_inbound.Utils.readCookie(key))});
3312
- }
3313
- } catch(e){
3314
- return null;
3315
- }
3316
- } else {
3317
- for (var j in ls){
3318
- if (j.length){
3319
- items.push({key:j, value:this.parseResult(ls.getItem(j))});
3320
- }
3321
- }
3322
- }
3323
- return items;
3324
- },
3325
- parseResult: function(res){
3326
- var ret;
3327
- try {
3328
- ret = JSON.parse(res);
3329
- if (typeof ret == 'undefined'){
3330
- ret = res;
3331
- }
3332
- if (ret == 'true'){
3333
- ret = true;
3334
- }
3335
- if (ret == 'false'){
3336
- ret = false;
3337
- }
3338
- if (parseFloat(ret) == ret && typeof ret != "object"){
3339
- ret = parseFloat(ret);
3340
- }
3341
- } catch(e){
3342
- ret = res;
3343
- }
3344
- return ret;
3345
- }
3346
- };
3347
- })(_inbound || {});
3348
- /**
3349
- * Leads API functions
3350
- * @param Object _inbound - Main JS object
3351
- * @return Object - include event triggers
3352
- */
3353
- var _inboundLeadsAPI = (function(_inbound) {
3354
- var httpRequest;
3355
- _inbound.LeadsAPI = {
3356
- init: function() {
3357
-
3358
- var utils = _inbound.Utils,
3359
- wp_lead_uid = utils.readCookie("wp_lead_uid"),
3360
- wp_lead_id = utils.readCookie("wp_lead_id"),
3361
- expire_check = utils.readCookie("lead_data_expire");
3362
-
3363
- if (!expire_check) {
3364
- _inbound.deBugger('leads', 'expired vistor. Run Processes');
3365
- //var data_to_lookup = global-localized-vars;
3366
- if (wp_lead_id) {
3367
- /* Get InboundLeadData */
3368
- _inbound.LeadsAPI.getAllLeadData();
3369
- }
3370
- }
3371
- },
3372
- setGlobalLeadData: function(data) {
3373
- InboundLeadData = data;
3374
- },
3375
- getAllLeadData: function(expire_check) {
3376
- var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id"),
3377
- leadData = _inbound.totalStorage('inbound_lead_data'),
3378
- leadDataExpire = _inbound.Utils.readCookie("lead_data_expire");
3379
- data = {
3380
- action: 'inbound_get_all_lead_data',
3381
- wp_lead_id: wp_lead_id
3382
- },
3383
- success = function(returnData) {
3384
- var leadData = JSON.parse(returnData);
3385
- _inbound.LeadsAPI.setGlobalLeadData(leadData);
3386
- _inbound.totalStorage('inbound_lead_data', leadData); // store lead data
3387
-
3388
- /* Set 3 day timeout for checking DB for new lead data for Lead_Global var */
3389
- var d = new Date();
3390
- d.setTime(d.getTime() + 30 * 60 * 1000);
3391
- var expire = _inbound.Utils.addDays(d, 3);
3392
- _inbound.Utils.createCookie("lead_data_expire", true, expire);
3393
-
3394
- };
3395
-
3396
- if (!leadData) {
3397
- // Get New Lead Data from DB
3398
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
3399
-
3400
- } else {
3401
- // set global lead var with localstorage data
3402
- _inbound.LeadsAPI.setGlobalLeadData(leadData);
3403
- _inbound.deBugger('lead', 'Set Global Lead Data from Localstorage');
3404
-
3405
- if (!leadDataExpire) {
3406
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
3407
- //console.log('Set Global Lead Data from Localstorage');
3408
- _inbound.deBugger('lead', 'localized data old. Pull new from DB');
3409
- //console.log('localized data old. Pull new from DB');
3410
- }
3411
- }
3412
-
3413
- },
3414
- getLeadLists: function() {
3415
- var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id");
3416
- var data = {
3417
- action: 'wpl_check_lists',
3418
- wp_lead_id: wp_lead_id
3419
- };
3420
- var success = function(user_id) {
3421
- _inbound.Utils.createCookie("lead_session_list_check", true, {
3422
- path: '/',
3423
- expires: 1
3424
- });
3425
- _inbound.deBugger('lead', "Lists checked");
3426
- //console.log("Lists checked");
3427
- };
3428
- //_inbound.Utils.doAjax(data, success);
3429
- _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
3430
- }
3431
- };
3432
-
3433
- return _inbound;
3434
-
3435
- })(_inbound || {});
3436
  /**
3437
  * # Page View Tracking
3438
  *
@@ -3827,7 +3827,7 @@ var _inboundPageTracking = (function(_inbound) {
3827
 
3828
  return _inbound;
3829
 
3830
- })(_inbound || {});
3831
  /**
3832
  * # Start
3833
  *
1
+ /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
  /**
3
  * # _inbound
4
  *
129
 
130
  return Analytics;
131
 
132
+ })(_inboundOptions);
133
  /**
134
  * # Hooks & Filters
135
  *
534
 
535
  return _inbound;
536
 
537
+ })(_inbound || {});
538
  /**
539
  * # _inbound UTILS
540
  *
1393
  return _inbound;
1394
 
1395
  })(_inbound || {});
1396
+
1397
  /**
1398
  * # Inbound Forms
1399
  *
2601
  return _inbound;
2602
 
2603
  })(_inbound || {});
2604
+
2605
  /**
2606
  * # Analytics Events
2607
  *
3211
  }
3212
 
3213
  _inbound.add_action( 'form_after_submission', inboundFormNoRedirectContent, 10 );
3214
+
3215
+ /* LocalStorage Component */
3216
+ var InboundTotalStorage = (function (_inbound){
3217
+
3218
+ var supported, ls, mod = '_inbound';
3219
+ if ('localStorage' in window){
3220
+ try {
3221
+ ls = (typeof window.localStorage === 'undefined') ? undefined : window.localStorage;
3222
+ if (typeof ls == 'undefined' || typeof window.JSON == 'undefined'){
3223
+ supported = false;
3224
+ } else {
3225
+ supported = true;
3226
+ }
3227
+ window.localStorage.setItem(mod, '1');
3228
+ window.localStorage.removeItem(mod);
3229
+ }
3230
+ catch (err){
3231
+ supported = false;
3232
+ }
3233
+ }
3234
+
3235
+ /* Make the methods public */
3236
+ _inbound.totalStorage = function(key, value, options){
3237
+ return _inbound.totalStorage.impl.init(key, value);
3238
+ };
3239
+
3240
+ _inbound.totalStorage.setItem = function(key, value){
3241
+ return _inbound.totalStorage.impl.setItem(key, value);
3242
+ };
3243
+
3244
+ _inbound.totalStorage.getItem = function(key){
3245
+ return _inbound.totalStorage.impl.getItem(key);
3246
+ };
3247
+
3248
+ _inbound.totalStorage.getAll = function(){
3249
+ return _inbound.totalStorage.impl.getAll();
3250
+ };
3251
+
3252
+ _inbound.totalStorage.deleteItem = function(key){
3253
+ return _inbound.totalStorage.impl.deleteItem(key);
3254
+ };
3255
+
3256
+
3257
+ _inbound.totalStorage.impl = {
3258
+
3259
+ init: function(key, value){
3260
+ if (typeof value != 'undefined') {
3261
+ return this.setItem(key, value);
3262
+ } else {
3263
+ return this.getItem(key);
3264
+ }
3265
+ },
3266
+
3267
+ setItem: function(key, value){
3268
+ if (!supported){
3269
+ try {
3270
+ _inbound.Utils.createCookie(key, value);
3271
+ return value;
3272
+ } catch(e){
3273
+ console.log('Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie');
3274
+ }
3275
+ }
3276
+ var saver = JSON.stringify(value);
3277
+ ls.setItem(key, saver);
3278
+ return this.parseResult(saver);
3279
+ },
3280
+ getItem: function(key){
3281
+ if (!supported){
3282
+ try {
3283
+ return this.parseResult(_inbound.Utils.readCookie(key));
3284
+ } catch(e){
3285
+ return null;
3286
+ }
3287
+ }
3288
+ var item = ls.getItem(key);
3289
+ return this.parseResult(item);
3290
+ },
3291
+ deleteItem: function(key){
3292
+ if (!supported){
3293
+ try {
3294
+ _inbound.Utils.eraseCookie(key, null);
3295
+ return true;
3296
+ } catch(e){
3297
+ return false;
3298
+ }
3299
+ }
3300
+ ls.removeItem(key);
3301
+ return true;
3302
+ },
3303
+ getAll: function(){
3304
+ var items = [];
3305
+ if (!supported){
3306
+ try {
3307
+ var pairs = document.cookie.split(";");
3308
+ for (var i = 0; i<pairs.length; i++){
3309
+ var pair = pairs[i].split('=');
3310
+ var key = pair[0];
3311
+ items.push({key:key, value:this.parseResult(_inbound.Utils.readCookie(key))});
3312
+ }
3313
+ } catch(e){
3314
+ return null;
3315
+ }
3316
+ } else {
3317
+ for (var j in ls){
3318
+ if (j.length){
3319
+ items.push({key:j, value:this.parseResult(ls.getItem(j))});
3320
+ }
3321
+ }
3322
+ }
3323
+ return items;
3324
+ },
3325
+ parseResult: function(res){
3326
+ var ret;
3327
+ try {
3328
+ ret = JSON.parse(res);
3329
+ if (typeof ret == 'undefined'){
3330
+ ret = res;
3331
+ }
3332
+ if (ret == 'true'){
3333
+ ret = true;
3334
+ }
3335
+ if (ret == 'false'){
3336
+ ret = false;
3337
+ }
3338
+ if (parseFloat(ret) == ret && typeof ret != "object"){
3339
+ ret = parseFloat(ret);
3340
+ }
3341
+ } catch(e){
3342
+ ret = res;
3343
+ }
3344
+ return ret;
3345
+ }
3346
+ };
3347
+ })(_inbound || {});
3348
+ /**
3349
+ * Leads API functions
3350
+ * @param Object _inbound - Main JS object
3351
+ * @return Object - include event triggers
3352
+ */
3353
+ var _inboundLeadsAPI = (function(_inbound) {
3354
+ var httpRequest;
3355
+ _inbound.LeadsAPI = {
3356
+ init: function() {
3357
+
3358
+ var utils = _inbound.Utils,
3359
+ wp_lead_uid = utils.readCookie("wp_lead_uid"),
3360
+ wp_lead_id = utils.readCookie("wp_lead_id"),
3361
+ expire_check = utils.readCookie("lead_data_expire");
3362
+
3363
+ if (!expire_check) {
3364
+ _inbound.deBugger('leads', 'expired vistor. Run Processes');
3365
+ //var data_to_lookup = global-localized-vars;
3366
+ if (wp_lead_id) {
3367
+ /* Get InboundLeadData */
3368
+ _inbound.LeadsAPI.getAllLeadData();
3369
+ }
3370
+ }
3371
+ },
3372
+ setGlobalLeadData: function(data) {
3373
+ InboundLeadData = data;
3374
+ },
3375
+ getAllLeadData: function(expire_check) {
3376
+ var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id"),
3377
+ leadData = _inbound.totalStorage('inbound_lead_data'),
3378
+ leadDataExpire = _inbound.Utils.readCookie("lead_data_expire");
3379
+ data = {
3380
+ action: 'inbound_get_all_lead_data',
3381
+ wp_lead_id: wp_lead_id
3382
+ },
3383
+ success = function(returnData) {
3384
+ var leadData = JSON.parse(returnData);
3385
+ _inbound.LeadsAPI.setGlobalLeadData(leadData);
3386
+ _inbound.totalStorage('inbound_lead_data', leadData); // store lead data
3387
+
3388
+ /* Set 3 day timeout for checking DB for new lead data for Lead_Global var */
3389
+ var d = new Date();
3390
+ d.setTime(d.getTime() + 30 * 60 * 1000);
3391
+ var expire = _inbound.Utils.addDays(d, 3);
3392
+ _inbound.Utils.createCookie("lead_data_expire", true, expire);
3393
+
3394
+ };
3395
+
3396
+ if (!leadData) {
3397
+ // Get New Lead Data from DB
3398
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
3399
+
3400
+ } else {
3401
+ // set global lead var with localstorage data
3402
+ _inbound.LeadsAPI.setGlobalLeadData(leadData);
3403
+ _inbound.deBugger('lead', 'Set Global Lead Data from Localstorage');
3404
+
3405
+ if (!leadDataExpire) {
3406
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
3407
+ //console.log('Set Global Lead Data from Localstorage');
3408
+ _inbound.deBugger('lead', 'localized data old. Pull new from DB');
3409
+ //console.log('localized data old. Pull new from DB');
3410
+ }
3411
+ }
3412
+
3413
+ },
3414
+ getLeadLists: function() {
3415
+ var wp_lead_id = _inbound.Utils.readCookie("wp_lead_id");
3416
+ var data = {
3417
+ action: 'wpl_check_lists',
3418
+ wp_lead_id: wp_lead_id
3419
+ };
3420
+ var success = function(user_id) {
3421
+ _inbound.Utils.createCookie("lead_session_list_check", true, {
3422
+ path: '/',
3423
+ expires: 1
3424
+ });
3425
+ _inbound.deBugger('lead', "Lists checked");
3426
+ //console.log("Lists checked");
3427
+ };
3428
+ //_inbound.Utils.doAjax(data, success);
3429
+ _inbound.Utils.ajaxPost(inbound_settings.admin_url, data, success);
3430
+ }
3431
+ };
3432
+
3433
+ return _inbound;
3434
+
3435
+ })(_inbound || {});
3436
  /**
3437
  * # Page View Tracking
3438
  *
3827
 
3828
  return _inbound;
3829
 
3830
+ })(_inbound || {});
3831
  /**
3832
  * # Start
3833
  *
shared/assets/js/frontend/analytics/inboundAnalytics.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
  function inboundFormNoRedirect(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])');0!=n.length&&"IA=="!=n[0].value||(t.action="javascript:void(0)")}}function inboundFormNoRedirectContent(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),n=jQuery(e).css("background"),o=jQuery(e).css("color"),i=jQuery(e).css("height"),a=e.getElementsByClassName("inbound-form-spinner");0!=t.length&&"IA=="!=t[0].value||(jQuery(a).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+n+"; color="+o+"; font-size:calc("+i+' * .42);"></i></div>'))}}var inbound_data=inbound_data||{},_inboundOptions=_inboundOptions||{},_gaq=_gaq||[],_inbound=function(e){var t={timeout:inbound_settings.is_admin?500:1e4,formAutoTracking:!0,formAutoPopulation:!0},n={init:function(){_inbound.Utils.init(),_inbound.Utils.domReady(window,function(){_inbound.DomLoaded()})},DomLoaded:function(){_inbound.PageTracking.init(),_inbound.Forms.init(),_inbound.Utils.setUrlParams(),_inbound.LeadsAPI.init(),setTimeout(function(){_inbound.Forms.init()},2e3),_inbound.trigger("analytics_ready")},extend:function(e,t){var n,o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o},debug:function(e,t){},deBugger:function(e,t,n){if(console){var o,i,a,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(a=(r=r.split("-"))[1]),i="true"===_inbound.Utils.readCookie("inbound_debug"),((o="true"===_inbound.Utils.readCookie("inbound_debug_"+e))||s||i)&&(t&&"string"==typeof t&&(i||"all"===a?console.log('logAll "'+e+'" =>',t):o?console.log('log "'+e+'" =>',t):e===a&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},o=n.extend(t,e);return n.Settings=o||{},n}(_inboundOptions),_inboundHooks=function(e){return e.hooks=new function(){function e(e,t,n,o){if(a[e][t])if(n){var i,r=a[e][t];if(o)for(i=r.length;i--;){var s=r[i];s.callback===n&&s.context===o&&r.splice(i,1)}else for(i=r.length;i--;)r[i].callback===n&&r.splice(i,1)}else a[e][t]=[]}function t(e,t,o,i,r){var s={callback:o,priority:i,context:r},l=a[e][t];l?(l.push(s),l=n(l)):l=[s],a[e][t]=l}function n(e){for(var t,n,o,i=1,a=e.length;i<a;i++){for(t=e[i],n=i;(o=e[n-1])&&o.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function o(e,t,n){var o=a[e][t];if(!o)return"filters"===e&&n[0];var i=0,r=o.length;if("filters"===e)for(;i<r;i++)n[0]=o[i].callback.apply(o[i].context,n);else for(;i<r;i++)o[i].callback.apply(o[i].context,n);return"filters"!==e||n[0]}var i={removeFilter:function(t,n){return"string"==typeof t&&e("filters",t,n),i},applyFilters:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?o("filters",t,e):i},addFilter:function(e,n,o,a){return"string"==typeof e&&"function"==typeof n&&t("filters",e,n,o=parseInt(o||10,10)),i},removeAction:function(t,n){return"string"==typeof t&&e("actions",t,n),i},doAction:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&o("actions",t,e),i},addAction:function(e,n,o,a){return"string"==typeof e&&"function"==typeof n&&t("actions",e,n,o=parseInt(o||10,10),a),i}},a={actions:{},filters:{}};return i},e.add_action=function(){var t=arguments[0].split(" ");for(k in t)arguments[0]="inbound."+t[k],e.hooks.addAction.apply(this,arguments);return this},e.remove_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeAction.apply(this,arguments),this},e.do_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.doAction.apply(this,arguments),this},e.add_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.addFilter.apply(this,arguments),this},e.remove_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeFilter.apply(this,arguments),this},e.apply_filters=function(){return arguments[0]="inbound."+arguments[0],e.hooks.applyFilters.apply(this,arguments)},e}(_inbound||{}),_inboundUtils=function(e){var t,n=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,o=(Object.prototype.toString,{api_host:("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/$/,""),track_pageview:!0,track_links_timeout:300,cookie_name:"_sp",cookie_expiration:365,cookie_domain:(host=location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i))?host[0]:""});return e.Utils={init:function(){this.polyFills(),this.checkLocalStorage(),this.SetUID(),this.storeReferralData()},polyFills:function(){window.console||(window.console={});for(var e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],t=0;t<e.length;t++)window.console[e[t]]||(window.console[e[t]]=function(){});Date.prototype.toISOString||function(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}();try{new CustomEvent("?")}catch(e){this.CustomEvent=function(e,t){function n(t,n,o,i){this["init"+e](t,n,o,i),"detail"in this||(this.detail=i)}return function(o,i){var a=document.createEvent(e);return null!==o?n.call(a,o,(i||(i=t)).bubbles,i.cancelable,i.detail):a.initCustomEvent=n,a}}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),o=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)(t=document._qsa.shift()).style.removeAttribute("x-qsa"),o.push(t);return document._qsa=null,o}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),!("innerText"in document.createElement("a"))&&"getSelection"in window&&HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e,t=window.getSelection(),n=[],o=0;o<t.rangeCount;o++)n[o]=t.getRangeAt(o);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(o=0;o<n.length;o++)t.addRange(n[o]);return e})},createCookie:function(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toGMTString()}document.cookie=e+"="+t+o+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null},eraseCookie:function(e){this.createCookie(e,"",-1)},getAllCookies:function(){var t={};if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o].split("=");i[0]=i[0].replace(/^ /,""),t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},o=window.location.search.substring(1),i=/([^&=]+)=?([^&]*)/g;e=i.exec(o);)if("-1"==e[1].indexOf("["))n[t(e[1])]=t(e[2]);else{var a=e[1].indexOf("["),r=e[1].slice(a+1,e[1].indexOf("]",a)),s=t(e[1].slice(0,a));"object"!=typeof n[s]&&(n[t(s)]={},n[t(s)].length=0),r?n[t(s)][t(r)]=t(e[2]):Array.prototype.push.call(n[t(s)],t(e[2]))}}();for(var o in n)if("action"!=o)if("object"==typeof n[o])for(var i in n[o])this.createCookie(i,n[o][i],30);else this.createCookie(o,n[o],30);if(t){var a=e.totalStorage("inbound_url_params")||{},r=this.mergeObjs(a,n);e.totalStorage("inbound_url_params",r)}var s={option1:"yo",option2:"woooo"};e.trigger("url_parameters",n,s)},getAllUrlParams:function(){n={};if(t)var n=e.totalStorage("inbound_url_params");return n},getParameterVal:function(e,t){return(RegExp(e+"=(.+?)(&|$)").exec(t)||[,!1])[1]},checkLocalStorage:function(){if("localStorage"in window)try{ls=void 0===window.localStorage?void 0:window.localStorage,t="undefined"!=typeof ls&&void 0!==window.JSON}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}var n=Object.keys(localStorage).map(function(t){return{name:t,size:e(localStorage[t])}}).map(function(e){return e.size=t(e.size).toFixed(2)+" MB",e});console.table(n)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=t<10?"0":"",o=e.getFullYear(),i=e.getHours(),a=i<10?"0":"",r=e.getMinutes(),s=r<10?"0":"",l=e.getSeconds(),u=l<10?"0":"",d=e.getMonth()+1;return o+"/"+(d<10?"0":"")+d+"/"+n+t+" "+a+i+":"+s+r+":"+u+l},SetSessionTimeout:function(){this.readCookie("lead_session_expire");var e=new Date;e.setTime(e.getTime()+18e5),this.createCookie("lead_session_expire",!0,e)},storeReferralData:function(){var t=new Date,n=document.referrer||"Direct Traffic",o=e.Utils.readCookie("inbound_referral_site"),i=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),o||this.createCookie("inbound_referral_site",n,t),i||e.totalStorage("inbound_original_referral",i)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n},generateGUID:function(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,guid)},SetUID:function(e){if(!this.readCookie("wp_lead_uid")){var t=e||this.CreateUID(35);this.createCookie("wp_lead_uid",t)}},countProperties:function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&++t;return t},mergeObjs:function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n},hasClass:function(e,t){if("classList"in document.documentElement)n=t.classList.contains(e);else var n=new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className);return n},addClass:function(e,t){"classList"in document.documentElement?t.classList.add(e):this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(e,t){"classList"in document.documentElement?t.classList.remove(e):this.hasClass(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)*"+e+"(\\s|$)*","g"),""))},removeElement:function(e){e.parentNode.removeChild(e)},trim:function(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n")},ajaxPolyFill:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var e,t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<t.length;n++)try{e=new ActiveXObject(t[n]);break}catch(e){}return e},ajaxSendData:function(e,t,n,o,i){var a=this.ajaxPolyFill();setTimeout(function(){a.open(n,e,!0),a.onreadystatechange=function(){4==a.readyState&&t(a.responseText)},"POST"==n&&a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o)},100)},ajaxGet:function(e,t,n,o){var i=[];for(var a in t)i.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e+"?"+i.join("&"),n,"GET",null,o)},ajaxPost:function(e,t,n,o){var i=[];for(var a in t)i.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e,n,"POST",i.join("&"),o)},sendEvent:function(e,t,i){t=t||{},async=!0;var a=getCookie();if(a){var r;for(r in a)t[r]=a[r]}t.id||(t.id=getId());var s={e:e,t:(new Date).toISOString(),kv:t},l=o.api_host+"/track?data="+encodeURIComponent(JSON.stringify(s));if(n){var u=new XMLHttpRequest;u.open("GET",l,async),u.withCredentials=async,u.send(null)}else{var d=document.createElement("script");d.type="text/javascript",d.async=async,d.defer=async,d.src=l;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}return action(i),self},domReady:function(e,t){var n=!1,o=!0,i=e.document,a=i.documentElement,r=i.addEventListener?"addEventListener":"attachEvent",s=i.addEventListener?"removeEventListener":"detachEvent",l=i.addEventListener?"":"on",u=function(o){"readystatechange"==o.type&&"complete"!=i.readyState||(("load"==o.type?e:i)[s](l+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}u("poll")};if("complete"==i.readyState)t.call(e,"lazy");else{if(i.createEventObject&&a.doScroll){try{o=!e.frameElement}catch(e){}o&&d()}i[r](l+"DOMContentLoaded",u,!1),i[r](l+"readystatechange",u,!1),e[r](l+"load",u,!1)}},addListener:function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},throttle:function(e,t){var n,o,i,a=null,r=0,s=function(){r=new Date,a=null,i=e.apply(n,o)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,o=arguments,u<=0?(clearTimeout(a),a=null,r=l,i=e.apply(n,o)):a||(a=setTimeout(s,u)),i}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),void 0!==_gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)},cacheSearchData:function(n,o){if(t){var i=e.totalStorage.getItem("inbound_search_storage");if(i)i.unshift(n),e.totalStorage.setItem("inbound_search_storage",i);else{var a=[n];e.totalStorage.setItem("inbound_search_storage",a)}}else{var r=JSON.stringify(n),s=this.readCookie("inbound_search_storage");s&&(r+="SPLIT-TOKEN"+s),this.createCookie("inbound_search_storage",r,"180")}e.Forms.releaseFormSubmit(o)},storeSearchData:function(){if(inbound_settings.wp_lead_data.lead_id&&inbound_settings.wp_lead_data.lead_nonce){var t=[],n=e.totalStorage.getItem("inbound_search_storage"),o=this.readCookie("inbound_search_storage");if(n||o){if(o){o=o.split("SPLIT-TOKEN");for(var i in o)t.push(JSON.parse(o[i]))}n&&(t=t.concat(n)),t.sort(function(e,t){return e.timestamp-t.timestamp});var a={action:"inbound_search_store",data:t=encodeURIComponent(JSON.stringify(t)),nonce:inbound_settings.wp_lead_data.lead_nonce,lead_id:inbound_settings.wp_lead_data.lead_id};callback=function(t){t&&(t=JSON.parse(t)),t.success&&(console.log(t.success),e.Utils.eraseCookie("inbound_search_storage"),e.totalStorage.deleteItem("inbound_search_storage")),t.error&&console.log(t.error)},this.ajaxPost(inbound_settings.admin_url,a,callback)}}}},e}(_inbound||{}),InboundForms=function(e){var t=e.Utils,n=[],o=[],a=[],r={},s=e.Settings,l=["first name","last name","name","email","e-mail","phone","website","job title","your favorite food","company","tele","address","comment"];if(e.Forms={init:function(){e.Forms.runFieldMappingFilters(),e.Forms.formTrackInit(),e.Forms.searchTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,t){return},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=window.document.forms[e];t.dataset.formProcessed||(t.dataset.formProcessed=!0,this.checkTrackStatus(t)&&(this.attachFormSubmitEvent(t),this.initFormMapping(t)))}},searchTrackInit:function(){if("off"!=inbound_settings.search_tracking&&!r.searchTrackInit){for(var e=0;e<window.document.forms.length;e++){var n=window.document.forms[e];n.dataset.searchChecked||(n.dataset.searchChecked=!0,this.checkSearchTrackStatus(n)&&this.attachSearchFormSubmitEvent(n))}t.storeSearchData(),r.searchTrackInit=!0}},checkTrackStatus:function(t){var n=t.getAttribute("class");if(""!==n&&null!==n)return n.toLowerCase().indexOf("wpl-track-me")>-1||(n.toLowerCase().indexOf("inbound-track")>-1||(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1))},checkSearchTrackStatus:function(t){var n=t.getAttribute("class"),o=t.getAttribute("id");return""!==n&&null!==n&&n.toLowerCase().indexOf("search")>-1||(""===o||null===o?(cb=function(){console.log(t)},e.deBugger("searches","This search form is not tracked. Please assign on in settings...",cb),!1):o.toLowerCase().indexOf("search")>-1||void 0)},loopClassSelectors:function(n,o){for(var i=n.length-1;i>=0;i--){var a=t.trim(n[i]);-1===a.indexOf("#")&&-1===a.indexOf(".")&&(a="#"+a),(a=document.querySelector(a))&&("add"===o?(e.Utils.addClass("wpl-track-me",a),e.Utils.addClass("inbound-track",a)):(e.Utils.removeClass("wpl-track-me",a),e.Utils.removeClass("inbound-track",a)))}},initFormMapping:function(t){for(var n=[],o=0;o<t.elements.length;o++)formInput=t.elements[o],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var i=n.length-1;i>=0;i--)formInput=n[i],this.mapField(formInput)},mapField:function(o){var a=o.id||!1,r=o.name||!1,s=this.getInputLabel(o);if(s&&this.ignoreFieldByLabel(s[0].innerText))return o.dataset.ignoreFormField=!0,!1;for(i=0;i<l.length;i++){var u=!1,d=l[i],c=t.trim(d),m=c.replace(/ /g,"_");r&&r.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching name attribute for -> "+c)):a&&a.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching ID attribute for ->"+c)):s?s[0].innerText.toLowerCase().indexOf(c)>-1&&(u=!0,e.deBugger("forms","Found matching sibling label for -> "+c)):n.push(c),u&&(this.addDataAttr(o,m),this.removeArrayItem(l,c),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},searchFormListener:function(t){t.preventDefault(),e.Forms.saveSearchData(t.target)},attachFormSubmitEvent:function(e){t.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},attachSearchFormSubmitEvent:function(e){t.addListener(e,"submit",this.searchFormListener)},ignoreFieldByLabel:function(t){var n=!1;return!!t&&(-1==t.toLowerCase().indexOf("credit card")&&-1==t.toLowerCase().indexOf("card number")||(n=!0),-1==t.toLowerCase().indexOf("expiration")&&-1==t.toLowerCase().indexOf("expiry")||(n=!0),"month"!=t.toLowerCase()&&"mm"!=t.toLowerCase()&&"yy"!=t.toLowerCase()&&"yyyy"!=t.toLowerCase()&&"year"!=t.toLowerCase()||(n=!0),-1==t.toLowerCase().indexOf("cvv")&&-1==t.toLowerCase().indexOf("cvc")&&-1==t.toLowerCase().indexOf("secure code")&&-1==t.toLowerCase().indexOf("security code")||(n=!0),n&&e.deBugger("forms","ignore "+t),n)},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;if("visa"!=e.toLowerCase()&&"mastercard"!=e.toLowerCase()&&"american express"!=e.toLowerCase()&&"amex"!=e.toLowerCase()&&"discover"!=e.toLowerCase()||(t=!0),new RegExp("/^[0-9]+$/").test(e)){var n=e.replace(" ","");this.isInt(n)&&n.length>=16&&(t=!0)}return t},isInt:function(e){return"number"==typeof e&&isFinite(e)&&e%1==0},releaseFormSubmit:function(e){document.body.style.cursor="default",t.removeClass("wpl-track-me",e),t.removeListener(e,"submit",this.formListener);var n=e.getAttribute("class");if(""!==n&&null!==n&&-1!=n.toLowerCase().indexOf("wpcf7-form"))return setTimeout(function(){document.body.style.cursor="default"},300),!0;e.submit(),setTimeout(function(){for(var t=0;t<e.elements.length;t++)formInput=e.elements[t],type=formInput.type||!1,"submit"===type&&"submit"===formInput.name&&e.elements[t].click()},2e3)},saveFormData:function(n){for(var i=i||{},r=0;r<n.elements.length;r++)if(formInput=n.elements[r],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("forms","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),i[inputName]||(i[inputName]={}),formInput.type&&(i[inputName].type=formInput.type),i[inputName].name||(i[inputName].name=formInput.name),formInput.dataset.mapFormField&&(i[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(l=this.getInputValue(formInput)))continue;break;case"TEXTAREA":l=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var s=0;s<formInput.length;s++)formInput[s].selected&&values.push(encodeURIComponent(formInput[s].value))}else l=formInput.value}if(e.deBugger("forms","Input Value = "+l),l){i[inputName].value||(i[inputName].value=[]),i[inputName].value.push(multiple?values.join(","):encodeURIComponent(l));var l=multiple?values.join(","):encodeURIComponent(l)}}e.deBugger("forms",i);for(var u in i){var d=i[u].value,c=i[u].map;if(void 0!==d&&null!=d&&""!=d&&o.push(u+"="+i[u].value.join(",")),void 0!==c&&null!=c&&i[u].value&&(a.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=o.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=a.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g),(m=t.getParameterVal("email",g)||t.readCookie("wp_lead_email"))||(m=t.getParameterVal("wpleads_email_address",g));var p=t.getParameterVal("name",g),h=t.getParameterVal("first_name",g),v=t.getParameterVal("last_name",g);if(!v&&h&&(_=decodeURI(h).split(" ")).length>0&&(h=_[0],v=_[1]),p&&!v&&!h){var _=decodeURI(p).split(" ");_.length>0&&(h=_[0],v=_[1])}p=h&&v?h+" "+v:p,h||(h=""),v||(v=""),e.deBugger("forms","fName = "+h),e.deBugger("forms","lName = "+v),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=n.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)k=!0;var S=n.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');S=S.length>0?S[0].value:0;if("undefined"!=typeof landing_path_info)C=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)C=cta_path_info.variation;else var C=inbound_settings.variation_id;var I=inbound_settings.post_type||"page",L=inbound_settings.post_id||0;search_data={},formData={action:"inbound_lead_store",email:m,full_name:p,first_name:h,last_name:v,raw_params:f,mapped_params:g,url_params:JSON.stringify(y),search_data:"test",page_views:JSON.stringify(b),post_type:I,page_id:L,variation:C,source:t.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:S,inbound_nonce:inbound_settings.ajax_nonce,event:n},callback=function(o){e.deBugger("forms","Lead Created with ID: "+o),o=parseInt(o,10),formData.leadID=o,o&&(t.createCookie("wp_lead_id",o),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(n)},e.trigger("form_before_submission",formData),t.ajaxPost(inbound_settings.admin_url,formData,callback)},saveSearchData:function(n){for(var o=o||{},i=0;i<n.elements.length;i++)if(formInput=n.elements[i],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("searches","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),o[inputName]||(o[inputName]={}),formInput.type&&(o[inputName].type=formInput.type),o[inputName].name||(o[inputName].name=formInput.name),formInput.dataset.mapFormField&&(o[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(r=this.getInputValue(formInput)))continue;break;case"TEXTAREA":r=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var a=0;a<formInput.length;a++)formInput[a].selected&&values.push(encodeURIComponent(formInput[a].value))}else r=formInput.value}if(e.deBugger("searches","Input Value = "+r),r){o[inputName].value||(o[inputName].value=[]),o[inputName].value.push(multiple?values.join(","):encodeURIComponent(r));var r=multiple?values.join(","):encodeURIComponent(r)}}e.deBugger("searches",o);var s=[];for(var l in o){var u=o[l].value,d=o[l].type;void 0!==u&&null!=u&&""!=u&&"search"==d&&s.push("search_text|value|"+o[l].value)}if(s[0]){var c=s.join("|field|");if(e.deBugger("searches","Stringified Search Form PARAMS: "+c),"undefined"!=typeof landing_path_info)m=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)m=cta_path_info.variation;else var m=inbound_settings.variation_id;var f=inbound_settings.post_type||"page",g=inbound_settings.post_id||0,p=t.readCookie("wp_lead_uid");inbound_settings.wp_lead_data.lead_email?email=inbound_settings.wp_lead_data.lead_email:t.readCookie("inbound_wpleads_email_address")?email=t.readCookie("inbound_wpleads_email_address"):email="",searchData={email:email,search_data:c,user_UID:p,post_type:f,page_id:g,variation:m,source:t.readCookie("inbound_referral_site"),ip_address:inbound_settings.ip_address,timestamp:Math.floor((new Date).getTime()/1e3)},e.trigger("search_before_caching",searchData),inbound_settings.wp_lead_data.lead_id?(searchData.lead_id=inbound_settings.wp_lead_data.lead_id,t.cacheSearchData(searchData,n)):t.cacheSearchData(searchData,n)}},rememberInputValues:function(n){n.name&&n.name;var o=n.type?n.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o||n.dataset.ignoreFormField)return!1;t.addListener(n,"change",function(n){if(n.target.name){if("checkbox"!==o)var i=n.target.value;else for(var a=[],r=document.querySelectorAll('input[name="'+n.target.name+'"]'),s=0;s<r.length;s++)r[s].checked&&a.push(r[s].value),i=a.join(",");inputData={name:n.target.name,node:n.target.nodeName.toLowerCase(),type:o,value:i,mapping:n.target.dataset.mapFormField},e.trigger("form_input_change",inputData),t.createCookie("inbound_"+n.target.name,encodeURIComponent(i))}})},fillInputValues:function(e){var n=e.name?"inbound_"+e.name:"",o=e.type?e.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o)return!1;if(t.readCookie(n)&&"comment"!=n)if(value=decodeURIComponent(t.readCookie(n)),"checkbox"===o||"radio"===o)for(var i=value.split(","),a=0;a<i.length;a++)e.value.indexOf(i[a])>-1&&(e.checked=!0);else"undefined"!==value&&(e.value=value)},getInputLabel:function(e){var t;return(t=this.siblingsIsLabel(e))?t:!!(t=this.CheckParentForLabel(e))&&t},getInputValue:function(e){var t=!1;switch(e.type){case"radio":case"checkbox":e.checked&&(t=e.value);break;case"text":case"hidden":default:t=e.value}return t},addDataAttr:function(e,t){for(var n=document.getElementsByName(e.name),o=n.length-1;o>=0;o--)e.dataset.mapFormField||(n[o].dataset.mapFormField=t)},removeArrayItem:function(e,t){if(e.indexOf)index=e.indexOf(t);else for(index=e.length-1;index>=0&&e[index]!==t;--index);index>=0&&e.splice(index,1)},siblingsIsLabel:function(e){for(var t=this.getSiblings(e),n=[],o=t.length-1;o>=0;o--)"label"===t[o].nodeName.toLowerCase()&&n.push(t[o]);return n.length>0&&n.length<2&&n},getChildren:function(e,t){for(var n=[];e;e=e.nextSibling)1==e.nodeType&&e!=t&&n.push(e);return n},getSiblings:function(e){return this.getChildren(e.parentNode.firstChild,e)},CheckParentForLabel:function(e){if("FORM"===e.nodeName)return null;do{var t=e.getElementsByTagName("label");if(t.length>0&&t.length<2)return e.getElementsByTagName("label")}while(e=e.parentNode);return null},mailCheck:function(){var e=document.querySelector(".inbound-email");e&&(t.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(n){var o=document.querySelector(".email_suggestion");o&&t.removeElement(o);var i=document.createElement("span");i.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+n.full+"</b></i>?</span>",e.parentNode.insertBefore(i,e.nextSibling);var a=document.getElementById("email_correction");t.addListener(a,"click",function(){e.value=a.innerHTML,a.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},void 0===u)var u={domainThreshold:1,topLevelThreshold:3,defaultDomains:["yahoo.com","google.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","mail.com","outlook.com","icloud.com"],defaultTopLevelDomains:["co.jp","co.uk","com","net","org","info","edu","gov","mil","ca","de"],run:function(e){e.domains=e.domains||u.defaultDomains,e.topLevelDomains=e.topLevelDomains||u.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||u.sift3Distance;var t=function(e){return e},n=e.suggested||t,o=e.empty||t,i=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return i?n(i):o()},suggest:function(e,t,n,o){e=e.toLowerCase();var i=this.splitEmail(e),a=this.findClosestDomain(i.domain,t,o,this.domainThreshold);if(a){if(a!=i.domain)return{address:i.address,domain:a,full:i.address+"@"+a}}else{var r=this.findClosestDomain(i.topLevelDomain,n,o,this.topLevelThreshold);if(i.domain&&r&&r!=i.topLevelDomain){var s=i.domain;return a=s.substring(0,s.lastIndexOf(i.topLevelDomain))+r,{address:i.address,domain:a,full:i.address+"@"+a}}}return!1},findClosestDomain:function(e,t,n,o){o=o||this.topLevelThreshold;var i,a=99,r=null;if(!e||!t)return!1;n||(n=this.sift3Distance);for(var s=0;s<t.length;s++){if(e===t[s])return e;(i=n(e,t[s]))<a&&(a=i,r=t[s])}return a<=o&&null!==r&&r},sift3Distance:function(e,t){if(null===e||0===e.length)return null===t||0===t.length?0:t.length;if(null===t||0===t.length)return e.length;for(var n=0,o=0,i=0,a=0;n+o<e.length&&n+i<t.length;){if(e.charAt(n+o)==t.charAt(n+i))a++;else{o=0,i=0;for(var r=0;r<5;r++){if(n+r<e.length&&e.charAt(n+r)==t.charAt(n)){o=r;break}if(n+r<t.length&&e.charAt(n)==t.charAt(n+r)){i=r;break}}}n++}return(e.length+t.length)/2-a},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(a=0;a<t.length;a++)if(""===t[a])return!1;var n=t.pop(),o=n.split("."),i="";if(0===o.length)return!1;if(1==o.length)i=o[0];else{for(var a=1;a<o.length;a++)i+=o[a]+".";o.length>=2&&(i=i.substring(0,i.length-1))}return{topLevelDomain:i,domain:n,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};return e}(_inbound||{}),_inboundEvents=function(e){function t(t,o,i){var o=o||{};(i=i||{}).bubbles=i.bubbles||!0,i.cancelable=i.cancelable||!0,o=e.apply_filters("filter_"+t,o);!window.ActiveXObject&&window;if("function"==typeof CustomEvent)var a=new CustomEvent(t,{detail:o,bubbles:i.bubbles,cancelable:i.cancelable});else(a=document.createEvent("Event")).initEvent(t,!0,!0);window.dispatchEvent(a),e.do_action(t,o),n(t,o)}function n(e,t){if(window.jQuery){var t=t||{};jQuery(document).trigger(e,t)}}e.trigger=function(t,n){e.Events[t](n)};return e.Events={analytics_ready:function(){t("analytics_ready",{data:"xyxy"},{opt1:!0})},url_parameters:function(e){t("url_parameters",e)},session_start:function(){console.log(""),t("session_start")},session_end:function(e){t("session_end",e),console.log("Session End")},session_active:function(){t("session_active")},session_idle:function(e){t("session_idle",e)},session_resume:function(){t("session_resume")},session_heartbeat:function(e){t("session_heartbeat",{clock:e,leadData:InboundLeadData})},page_visit:function(e){t("page_view",e)},page_first_visit:function(n){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);e.deBugger("pages",status,function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")})},tab_hidden:function(n){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(n){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(n){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){e.deBugger("forms","inputData change. Data=",function(){console.log(n)}),t("form_input_change",n)},form_before_submission:function(e){t("form_before_submission",e)},form_after_submission:function(e){t("form_after_submission",e)},search_before_caching:function(e){t("search_before_caching",e)},analyticsError:function(e,t,n){var o=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(o),console.log("Page Save Error")}},e}(_inbound||{});_inbound.add_action("form_before_submission",inboundFormNoRedirect,10),_inbound.add_action("form_after_submission",inboundFormNoRedirectContent,10);var InboundTotalStorage=function(e){var t,n;if("localStorage"in window)try{n=void 0===window.localStorage?void 0:window.localStorage,t=void 0!==n&&void 0!==window.JSON,window.localStorage.setItem("_inbound","1"),window.localStorage.removeItem("_inbound")}catch(e){t=!1}e.totalStorage=function(t,n,o){return e.totalStorage.impl.init(t,n)},e.totalStorage.setItem=function(t,n){return e.totalStorage.impl.setItem(t,n)},e.totalStorage.getItem=function(t){return e.totalStorage.impl.getItem(t)},e.totalStorage.getAll=function(){return e.totalStorage.impl.getAll()},e.totalStorage.deleteItem=function(t){return e.totalStorage.impl.deleteItem(t)},e.totalStorage.impl={init:function(e,t){return void 0!==t?this.setItem(e,t):this.getItem(e)},setItem:function(o,i){if(!t)try{return e.Utils.createCookie(o,i),i}catch(e){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var a=JSON.stringify(i);return n.setItem(o,a),this.parseResult(a)},getItem:function(o){if(!t)try{return this.parseResult(e.Utils.readCookie(o))}catch(e){return null}var i=n.getItem(o);return this.parseResult(i)},deleteItem:function(o){if(!t)try{return e.Utils.eraseCookie(o,null),!0}catch(e){return!1}return n.removeItem(o),!0},getAll:function(){var o=[];if(t)for(var i in n)i.length&&o.push({key:i,value:this.parseResult(n.getItem(i))});else try{for(var a=document.cookie.split(";"),r=0;r<a.length;r++){var s=a[r].split("=")[0];o.push({key:s,value:this.parseResult(e.Utils.readCookie(s))})}}catch(e){return null}return o},parseResult:function(e){var t;try{void 0===(t=JSON.parse(e))&&(t=e),"true"==t&&(t=!0),"false"==t&&(t=!1),parseFloat(t)==t&&"object"!=typeof t&&(t=parseFloat(t))}catch(n){t=e}return t}}}(_inbound||{}),_inboundLeadsAPI=function(e){return e.LeadsAPI={init:function(){var t=e.Utils,n=(t.readCookie("wp_lead_uid"),t.readCookie("wp_lead_id"));t.readCookie("lead_data_expire")||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(t){var n=e.Utils.readCookie("wp_lead_id"),o=e.totalStorage("inbound_lead_data"),i=e.Utils.readCookie("lead_data_expire");data={action:"inbound_get_all_lead_data",wp_lead_id:n},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var o=new Date;o.setTime(o.getTime()+18e5);var i=e.Utils.addDays(o,3);e.Utils.createCookie("lead_data_expire",!0,i)},o?(e.LeadsAPI.setGlobalLeadData(o),e.deBugger("lead","Set Global Lead Data from Localstorage"),i||(e.Utils.ajaxPost(inbound_settings.admin_url,data,success),e.deBugger("lead","localized data old. Pull new from DB"))):e.Utils.ajaxPost(inbound_settings.admin_url,data,success)},getLeadLists:function(){var t={action:"wpl_check_lists",wp_lead_id:e.Utils.readCookie("wp_lead_id")};e.Utils.ajaxPost(inbound_settings.admin_url,t,function(t){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")})}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,o=!1,i=!1,a=!1,r=parseInt(e.Utils.readCookie("lead_session"),10)||0,s=0,l=(new Date,null),u=null,d=null,c=e.Utils,m=e.Utils.GetDate(),f="page_views",g=e.totalStorage(f)||{},p=inbound_settings.post_id||window.location.pathname,h=e.Settings.timeout||1e4;return e.PageTracking={init:function(o){this.CheckTimeOut(),o=o||{},t=parseInt(o.reportInterval,10)||10,n=parseInt(o.idleTimeout,10)||3,c.addListener(document,"keydown",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(document,"click",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(window,"mousemove",c.throttle(e.PageTracking.pingSession,1e3)),e.PageTracking.checkVisibility(),this.startSession()},setIdle:function(t){var n="Session IDLE. Activity Timeout due to "+(t=t||"No Movement");e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n;void 0!==document.hidden?(t="hidden",n="visibilitychange"):void 0!==document.mozHidden?(t="mozHidden",n="mozvisibilitychange"):void 0!==document.msHidden?(t="msHidden",n="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",n="webkitvisibilitychange");var o=document[t];e.Utils.addListener(document,n,function(n){o!=document[t]&&(document[t]?(e.trigger("tab_hidden"),e.PageTracking.setIdle("browser tab switch")):(e.trigger("tab_visible"),e.PageTracking.pingSession()),o=document[t])})},clock:function(){var n="Total time spent on Page in this Session: "+((r+=1)/60).toFixed(2)+" min";if(e.deBugger("pages",n),r>0&&r%t==0){var o=new Date;o.setTime(o.getTime()+18e5),c.createCookie("lead_session",r,o),e.trigger("session_heartbeat",r)}},inactiveClock:function(){var t="Time until Session Timeout: "+((1800-(s+=1))/60).toFixed(2)+" min";e.deBugger("pages",t),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){i=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){i=!1,e.trigger("session_resume"),e.deBugger("pages","Activity resumed. Session Active"),clearTimeout(l),s=0,clearTimeout(u),l=setInterval(e.PageTracking.clock,1e3)},turnOff:function(){e.PageTracking.setIdle(),a=!0},turnOn:function(){a=!1},startSession:function(){new Date;if(o=!0,l=setInterval(e.PageTracking.clock,1e3),c.readCookie("lead_session"))e.trigger("session_active");else{e.trigger("session_start");var t=new Date;t.setTime(t.getTime()+18e5),e.Utils.createCookie("lead_session",1,t)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){a||(o||e.PageTracking.startSession(),i&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),void 0!==t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){if(e.Utils.checkLocalStorage()){var t=localStorage.getItem(f),n=JSON.parse(t);return n}},isRevisit:function(e){var t=!1,n=(e=e||{})[p];return void 0!==n&&null!==n&&(t=!0),t},triggerPageView:function(t){var n={title:document.title,url:document.location.href,path:document.location.pathname,count:1};t?(g[p].push(m),n.count=g[p].length,e.trigger("page_revisit",n)):(g[p]=[],g[p].push(m),e.trigger("page_first_visit",n)),e.trigger("page_visit",n),e.totalStorage(f,g),this.storePageView()},CheckTimeOut:function(){var t,n=this.isRevisit(g);if(n){var o=g[p].length-1,i=g[p][o],a=Math.abs(new Date(i).getTime()-new Date(m).getTime());a>h?(t="Timeout Happened. Page view fired",this.triggerPageView(n)):(time_left=.001*Math.abs(h-a),t=h/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(n);e.deBugger("pages",t)},storePageView:function(){var t=!1;"off"==inbound_settings.page_tracking&&"landing-page"!=inbound_settings.post_type||(document.onreadystatechange=function(){"loading"!==document.readyState&&!1===t&&setTimeout(function(){var n=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",o=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",i=e.totalStorage("wp_cta_loaded"),a=e.totalStorage("wp_cta_impressions");t=!0,e.totalStorage("wp_cta_impressions",{});var r={action:"inbound_track_lead",wp_lead_uid:o,wp_lead_id:n,page_id:inbound_settings.post_id,variation_id:inbound_settings.variation_id,post_type:inbound_settings.post_type,current_url:window.location.href,page_views:JSON.stringify(e.PageTracking.getPageViews()),cta_impressions:JSON.stringify(a),cta_history:JSON.stringify(i),json:"0"};e.Utils.ajaxPost(inbound_settings.admin_url,r,function(e){})},200)})}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
1
+ /*! Inbound Analyticsv1.0.0 | (c) 2017 Inbound Now | https://github.com/inboundnow/cta */
2
  function inboundFormNoRedirect(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])');0!=n.length&&"IA=="!=n[0].value||(t.action="javascript:void(0)")}}function inboundFormNoRedirectContent(){if(null==window.frames.frameElement)e=document.querySelectorAll("button.inbound-button-submit[disabled]")[0];else if("iframe"==window.frames.frameElement.tagName.toLowerCase())var e=window.frames.frameElement.contentWindow.document.querySelectorAll("button.inbound-button-submit")[0];if(void 0!==e){var t=e.form.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),n=jQuery(e).css("background"),o=jQuery(e).css("color"),i=jQuery(e).css("height"),a=e.getElementsByClassName("inbound-form-spinner");0!=t.length&&"IA=="!=t[0].value||(jQuery(a).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+n+"; color="+o+"; font-size:calc("+i+' * .42);"></i></div>'))}}var inbound_data=inbound_data||{},_inboundOptions=_inboundOptions||{},_gaq=_gaq||[],_inbound=function(e){var t={timeout:inbound_settings.is_admin?500:1e4,formAutoTracking:!0,formAutoPopulation:!0},n={init:function(){_inbound.Utils.init(),_inbound.Utils.domReady(window,function(){_inbound.DomLoaded()})},DomLoaded:function(){_inbound.PageTracking.init(),_inbound.Forms.init(),_inbound.Utils.setUrlParams(),_inbound.LeadsAPI.init(),setTimeout(function(){_inbound.Forms.init()},2e3),_inbound.trigger("analytics_ready")},extend:function(e,t){var n,o={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(o[n]=t[n]);return o},debug:function(e,t){},deBugger:function(e,t,n){if(console){var o,i,a,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(a=(r=r.split("-"))[1]),i="true"===_inbound.Utils.readCookie("inbound_debug"),((o="true"===_inbound.Utils.readCookie("inbound_debug_"+e))||s||i)&&(t&&"string"==typeof t&&(i||"all"===a?console.log('logAll "'+e+'" =>',t):o?console.log('log "'+e+'" =>',t):e===a&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},o=n.extend(t,e);return n.Settings=o||{},n}(_inboundOptions),_inboundHooks=function(e){return e.hooks=new function(){function e(e,t,n,o){if(a[e][t])if(n){var i,r=a[e][t];if(o)for(i=r.length;i--;){var s=r[i];s.callback===n&&s.context===o&&r.splice(i,1)}else for(i=r.length;i--;)r[i].callback===n&&r.splice(i,1)}else a[e][t]=[]}function t(e,t,o,i,r){var s={callback:o,priority:i,context:r},l=a[e][t];l?(l.push(s),l=n(l)):l=[s],a[e][t]=l}function n(e){for(var t,n,o,i=1,a=e.length;i<a;i++){for(t=e[i],n=i;(o=e[n-1])&&o.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function o(e,t,n){var o=a[e][t];if(!o)return"filters"===e&&n[0];var i=0,r=o.length;if("filters"===e)for(;i<r;i++)n[0]=o[i].callback.apply(o[i].context,n);else for(;i<r;i++)o[i].callback.apply(o[i].context,n);return"filters"!==e||n[0]}var i={removeFilter:function(t,n){return"string"==typeof t&&e("filters",t,n),i},applyFilters:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?o("filters",t,e):i},addFilter:function(e,n,o,a){return"string"==typeof e&&"function"==typeof n&&t("filters",e,n,o=parseInt(o||10,10)),i},removeAction:function(t,n){return"string"==typeof t&&e("actions",t,n),i},doAction:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&o("actions",t,e),i},addAction:function(e,n,o,a){return"string"==typeof e&&"function"==typeof n&&t("actions",e,n,o=parseInt(o||10,10),a),i}},a={actions:{},filters:{}};return i},e.add_action=function(){var t=arguments[0].split(" ");for(k in t)arguments[0]="inbound."+t[k],e.hooks.addAction.apply(this,arguments);return this},e.remove_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeAction.apply(this,arguments),this},e.do_action=function(){return arguments[0]="inbound."+arguments[0],e.hooks.doAction.apply(this,arguments),this},e.add_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.addFilter.apply(this,arguments),this},e.remove_filter=function(){return arguments[0]="inbound."+arguments[0],e.hooks.removeFilter.apply(this,arguments),this},e.apply_filters=function(){return arguments[0]="inbound."+arguments[0],e.hooks.applyFilters.apply(this,arguments)},e}(_inbound||{}),_inboundUtils=function(e){var t,n=window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,o=(Object.prototype.toString,{api_host:("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/$/,""),track_pageview:!0,track_links_timeout:300,cookie_name:"_sp",cookie_expiration:365,cookie_domain:(host=location.hostname.match(/[a-z0-9][a-z0-9\-]+\.[a-z\.]{2,6}$/i))?host[0]:""});return e.Utils={init:function(){this.polyFills(),this.checkLocalStorage(),this.SetUID(),this.storeReferralData()},polyFills:function(){window.console||(window.console={});for(var e=["log","info","warn","error","debug","trace","dir","group","groupCollapsed","groupEnd","time","timeEnd","profile","profileEnd","dirxml","assert","count","markTimeline","timeStamp","clear"],t=0;t<e.length;t++)window.console[e[t]]||(window.console[e[t]]=function(){});Date.prototype.toISOString||function(){function e(e){var t=String(e);return 1===t.length&&(t="0"+t),t}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+e(this.getUTCMonth()+1)+"-"+e(this.getUTCDate())+"T"+e(this.getUTCHours())+":"+e(this.getUTCMinutes())+":"+e(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}();try{new CustomEvent("?")}catch(e){this.CustomEvent=function(e,t){function n(t,n,o,i){this["init"+e](t,n,o,i),"detail"in this||(this.detail=i)}return function(o,i){var a=document.createEvent(e);return null!==o?n.call(a,o,(i||(i=t)).bubbles,i.cancelable,i.detail):a.initCustomEvent=n,a}}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),o=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)(t=document._qsa.shift()).style.removeAttribute("x-qsa"),o.push(t);return document._qsa=null,o}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),!("innerText"in document.createElement("a"))&&"getSelection"in window&&HTMLElement.prototype.__defineGetter__("innerText",function(){for(var e,t=window.getSelection(),n=[],o=0;o<t.rangeCount;o++)n[o]=t.getRangeAt(o);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(o=0;o<n.length;o++)t.addRange(n[o]);return e})},createCookie:function(e,t,n){var o="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),o="; expires="+i.toGMTString()}document.cookie=e+"="+t+o+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var i=n[o];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null},eraseCookie:function(e){this.createCookie(e,"",-1)},getAllCookies:function(){var t={};if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var i=n[o].split("=");i[0]=i[0].replace(/^ /,""),t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},o=window.location.search.substring(1),i=/([^&=]+)=?([^&]*)/g;e=i.exec(o);)if("-1"==e[1].indexOf("["))n[t(e[1])]=t(e[2]);else{var a=e[1].indexOf("["),r=e[1].slice(a+1,e[1].indexOf("]",a)),s=t(e[1].slice(0,a));"object"!=typeof n[s]&&(n[t(s)]={},n[t(s)].length=0),r?n[t(s)][t(r)]=t(e[2]):Array.prototype.push.call(n[t(s)],t(e[2]))}}();for(var o in n)if("action"!=o)if("object"==typeof n[o])for(var i in n[o])this.createCookie(i,n[o][i],30);else this.createCookie(o,n[o],30);if(t){var a=e.totalStorage("inbound_url_params")||{},r=this.mergeObjs(a,n);e.totalStorage("inbound_url_params",r)}var s={option1:"yo",option2:"woooo"};e.trigger("url_parameters",n,s)},getAllUrlParams:function(){n={};if(t)var n=e.totalStorage("inbound_url_params");return n},getParameterVal:function(e,t){return(RegExp(e+"=(.+?)(&|$)").exec(t)||[,!1])[1]},checkLocalStorage:function(){if("localStorage"in window)try{ls=void 0===window.localStorage?void 0:window.localStorage,t="undefined"!=typeof ls&&void 0!==window.JSON}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}var n=Object.keys(localStorage).map(function(t){return{name:t,size:e(localStorage[t])}}).map(function(e){return e.size=t(e.size).toFixed(2)+" MB",e});console.table(n)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=t<10?"0":"",o=e.getFullYear(),i=e.getHours(),a=i<10?"0":"",r=e.getMinutes(),s=r<10?"0":"",l=e.getSeconds(),u=l<10?"0":"",d=e.getMonth()+1;return o+"/"+(d<10?"0":"")+d+"/"+n+t+" "+a+i+":"+s+r+":"+u+l},SetSessionTimeout:function(){this.readCookie("lead_session_expire");var e=new Date;e.setTime(e.getTime()+18e5),this.createCookie("lead_session_expire",!0,e)},storeReferralData:function(){var t=new Date,n=document.referrer||"Direct Traffic",o=e.Utils.readCookie("inbound_referral_site"),i=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),o||this.createCookie("inbound_referral_site",n,t),i||e.totalStorage("inbound_original_referral",i)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n},generateGUID:function(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,guid)},SetUID:function(e){if(!this.readCookie("wp_lead_uid")){var t=e||this.CreateUID(35);this.createCookie("wp_lead_uid",t)}},countProperties:function(e){var t=0;for(var n in e)e.hasOwnProperty(n)&&++t;return t},mergeObjs:function(e,t){var n={};for(var o in e)n[o]=e[o];for(var o in t)n[o]=t[o];return n},hasClass:function(e,t){if("classList"in document.documentElement)n=t.classList.contains(e);else var n=new RegExp("(^|\\s)"+e+"(\\s|$)").test(t.className);return n},addClass:function(e,t){"classList"in document.documentElement?t.classList.add(e):this.hasClass(t,e)||(t.className+=(t.className?" ":"")+e)},removeClass:function(e,t){"classList"in document.documentElement?t.classList.remove(e):this.hasClass(t,e)&&(t.className=t.className.replace(new RegExp("(^|\\s)*"+e+"(\\s|$)*","g"),""))},removeElement:function(e){e.parentNode.removeChild(e)},trim:function(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,"\n")},ajaxPolyFill:function(){if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;for(var e,t=["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp.2.0","Microsoft.XmlHttp"],n=0;n<t.length;n++)try{e=new ActiveXObject(t[n]);break}catch(e){}return e},ajaxSendData:function(e,t,n,o,i){var a=this.ajaxPolyFill();setTimeout(function(){a.open(n,e,!0),a.onreadystatechange=function(){4==a.readyState&&t(a.responseText)},"POST"==n&&a.setRequestHeader("Content-type","application/x-www-form-urlencoded"),a.send(o)},100)},ajaxGet:function(e,t,n,o){var i=[];for(var a in t)i.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e+"?"+i.join("&"),n,"GET",null,o)},ajaxPost:function(e,t,n,o){var i=[];for(var a in t)i.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e,n,"POST",i.join("&"),o)},sendEvent:function(e,t,i){t=t||{},async=!0;var a=getCookie();if(a){var r;for(r in a)t[r]=a[r]}t.id||(t.id=getId());var s={e:e,t:(new Date).toISOString(),kv:t},l=o.api_host+"/track?data="+encodeURIComponent(JSON.stringify(s));if(n){var u=new XMLHttpRequest;u.open("GET",l,async),u.withCredentials=async,u.send(null)}else{var d=document.createElement("script");d.type="text/javascript",d.async=async,d.defer=async,d.src=l;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(d,c)}return action(i),self},domReady:function(e,t){var n=!1,o=!0,i=e.document,a=i.documentElement,r=i.addEventListener?"addEventListener":"attachEvent",s=i.addEventListener?"removeEventListener":"detachEvent",l=i.addEventListener?"":"on",u=function(o){"readystatechange"==o.type&&"complete"!=i.readyState||(("load"==o.type?e:i)[s](l+o.type,u,!1),!n&&(n=!0)&&t.call(e,o.type||o))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}u("poll")};if("complete"==i.readyState)t.call(e,"lazy");else{if(i.createEventObject&&a.doScroll){try{o=!e.frameElement}catch(e){}o&&d()}i[r](l+"DOMContentLoaded",u,!1),i[r](l+"readystatechange",u,!1),e[r](l+"load",u,!1)}},addListener:function(e,t,n){e&&(e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n)},removeListener:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},throttle:function(e,t){var n,o,i,a=null,r=0,s=function(){r=new Date,a=null,i=e.apply(n,o)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,o=arguments,u<=0?(clearTimeout(a),a=null,r=l,i=e.apply(n,o)):a||(a=setTimeout(s,u)),i}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),void 0!==_gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)},cacheSearchData:function(n,o){if(t){var i=e.totalStorage.getItem("inbound_search_storage");if(i)i.unshift(n),e.totalStorage.setItem("inbound_search_storage",i);else{var a=[n];e.totalStorage.setItem("inbound_search_storage",a)}}else{var r=JSON.stringify(n),s=this.readCookie("inbound_search_storage");s&&(r+="SPLIT-TOKEN"+s),this.createCookie("inbound_search_storage",r,"180")}e.Forms.releaseFormSubmit(o)},storeSearchData:function(){if(inbound_settings.wp_lead_data.lead_id&&inbound_settings.wp_lead_data.lead_nonce){var t=[],n=e.totalStorage.getItem("inbound_search_storage"),o=this.readCookie("inbound_search_storage");if(n||o){if(o){o=o.split("SPLIT-TOKEN");for(var i in o)t.push(JSON.parse(o[i]))}n&&(t=t.concat(n)),t.sort(function(e,t){return e.timestamp-t.timestamp});var a={action:"inbound_search_store",data:t=encodeURIComponent(JSON.stringify(t)),nonce:inbound_settings.wp_lead_data.lead_nonce,lead_id:inbound_settings.wp_lead_data.lead_id};callback=function(t){t&&(t=JSON.parse(t)),t.success&&(console.log(t.success),e.Utils.eraseCookie("inbound_search_storage"),e.totalStorage.deleteItem("inbound_search_storage")),t.error&&console.log(t.error)},this.ajaxPost(inbound_settings.admin_url,a,callback)}}}},e}(_inbound||{}),InboundForms=function(e){var t=e.Utils,n=[],o=[],a=[],r={},s=e.Settings,l=["first name","last name","name","email","e-mail","phone","website","job title","your favorite food","company","tele","address","comment"];if(e.Forms={init:function(){e.Forms.runFieldMappingFilters(),e.Forms.formTrackInit(),e.Forms.searchTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,t){return},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=window.document.forms[e];t.dataset.formProcessed||(t.dataset.formProcessed=!0,this.checkTrackStatus(t)&&(this.attachFormSubmitEvent(t),this.initFormMapping(t)))}},searchTrackInit:function(){if("off"!=inbound_settings.search_tracking&&!r.searchTrackInit){for(var e=0;e<window.document.forms.length;e++){var n=window.document.forms[e];n.dataset.searchChecked||(n.dataset.searchChecked=!0,this.checkSearchTrackStatus(n)&&this.attachSearchFormSubmitEvent(n))}t.storeSearchData(),r.searchTrackInit=!0}},checkTrackStatus:function(t){var n=t.getAttribute("class");if(""!==n&&null!==n)return n.toLowerCase().indexOf("wpl-track-me")>-1||(n.toLowerCase().indexOf("inbound-track")>-1||(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1))},checkSearchTrackStatus:function(t){var n=t.getAttribute("class"),o=t.getAttribute("id");return""!==n&&null!==n&&n.toLowerCase().indexOf("search")>-1||(""===o||null===o?(cb=function(){console.log(t)},e.deBugger("searches","This search form is not tracked. Please assign on in settings...",cb),!1):o.toLowerCase().indexOf("search")>-1||void 0)},loopClassSelectors:function(n,o){for(var i=n.length-1;i>=0;i--){var a=t.trim(n[i]);-1===a.indexOf("#")&&-1===a.indexOf(".")&&(a="#"+a),(a=document.querySelector(a))&&("add"===o?(e.Utils.addClass("wpl-track-me",a),e.Utils.addClass("inbound-track",a)):(e.Utils.removeClass("wpl-track-me",a),e.Utils.removeClass("inbound-track",a)))}},initFormMapping:function(t){for(var n=[],o=0;o<t.elements.length;o++)formInput=t.elements[o],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var i=n.length-1;i>=0;i--)formInput=n[i],this.mapField(formInput)},mapField:function(o){var a=o.id||!1,r=o.name||!1,s=this.getInputLabel(o);if(s&&this.ignoreFieldByLabel(s[0].innerText))return o.dataset.ignoreFormField=!0,!1;for(i=0;i<l.length;i++){var u=!1,d=l[i],c=t.trim(d),m=c.replace(/ /g,"_");r&&r.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching name attribute for -> "+c)):a&&a.toLowerCase().indexOf(c)>-1?(u=!0,e.deBugger("forms","Found matching ID attribute for ->"+c)):s?s[0].innerText.toLowerCase().indexOf(c)>-1&&(u=!0,e.deBugger("forms","Found matching sibling label for -> "+c)):n.push(c),u&&(this.addDataAttr(o,m),this.removeArrayItem(l,c),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},searchFormListener:function(t){t.preventDefault(),e.Forms.saveSearchData(t.target)},attachFormSubmitEvent:function(e){t.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},attachSearchFormSubmitEvent:function(e){t.addListener(e,"submit",this.searchFormListener)},ignoreFieldByLabel:function(t){var n=!1;return!!t&&(-1==t.toLowerCase().indexOf("credit card")&&-1==t.toLowerCase().indexOf("card number")||(n=!0),-1==t.toLowerCase().indexOf("expiration")&&-1==t.toLowerCase().indexOf("expiry")||(n=!0),"month"!=t.toLowerCase()&&"mm"!=t.toLowerCase()&&"yy"!=t.toLowerCase()&&"yyyy"!=t.toLowerCase()&&"year"!=t.toLowerCase()||(n=!0),-1==t.toLowerCase().indexOf("cvv")&&-1==t.toLowerCase().indexOf("cvc")&&-1==t.toLowerCase().indexOf("secure code")&&-1==t.toLowerCase().indexOf("security code")||(n=!0),n&&e.deBugger("forms","ignore "+t),n)},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;if("visa"!=e.toLowerCase()&&"mastercard"!=e.toLowerCase()&&"american express"!=e.toLowerCase()&&"amex"!=e.toLowerCase()&&"discover"!=e.toLowerCase()||(t=!0),new RegExp("/^[0-9]+$/").test(e)){var n=e.replace(" ","");this.isInt(n)&&n.length>=16&&(t=!0)}return t},isInt:function(e){return"number"==typeof e&&isFinite(e)&&e%1==0},releaseFormSubmit:function(e){document.body.style.cursor="default",t.removeClass("wpl-track-me",e),t.removeListener(e,"submit",this.formListener);var n=e.getAttribute("class");if(""!==n&&null!==n&&-1!=n.toLowerCase().indexOf("wpcf7-form"))return setTimeout(function(){document.body.style.cursor="default"},300),!0;e.submit(),setTimeout(function(){for(var t=0;t<e.elements.length;t++)formInput=e.elements[t],type=formInput.type||!1,"submit"===type&&"submit"===formInput.name&&e.elements[t].click()},2e3)},saveFormData:function(n){for(var i=i||{},r=0;r<n.elements.length;r++)if(formInput=n.elements[r],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("forms","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),i[inputName]||(i[inputName]={}),formInput.type&&(i[inputName].type=formInput.type),i[inputName].name||(i[inputName].name=formInput.name),formInput.dataset.mapFormField&&(i[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(l=this.getInputValue(formInput)))continue;break;case"TEXTAREA":l=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var s=0;s<formInput.length;s++)formInput[s].selected&&values.push(encodeURIComponent(formInput[s].value))}else l=formInput.value}if(e.deBugger("forms","Input Value = "+l),l){i[inputName].value||(i[inputName].value=[]),i[inputName].value.push(multiple?values.join(","):encodeURIComponent(l));var l=multiple?values.join(","):encodeURIComponent(l)}}e.deBugger("forms",i);for(var u in i){var d=i[u].value,c=i[u].map;if(void 0!==d&&null!=d&&""!=d&&o.push(u+"="+i[u].value.join(",")),void 0!==c&&null!=c&&i[u].value&&(a.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=o.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=a.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g),(m=t.getParameterVal("email",g)||t.readCookie("wp_lead_email"))||(m=t.getParameterVal("wpleads_email_address",g));var p=t.getParameterVal("name",g),h=t.getParameterVal("first_name",g),v=t.getParameterVal("last_name",g);if(!v&&h&&(_=decodeURI(h).split(" ")).length>0&&(h=_[0],v=_[1]),p&&!v&&!h){var _=decodeURI(p).split(" ");_.length>0&&(h=_[0],v=_[1])}p=h&&v?h+" "+v:p,h||(h=""),v||(v=""),e.deBugger("forms","fName = "+h),e.deBugger("forms","lName = "+v),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=n.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)k=!0;var S=n.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');S=S.length>0?S[0].value:0;if("undefined"!=typeof landing_path_info)C=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)C=cta_path_info.variation;else var C=inbound_settings.variation_id;var I=inbound_settings.post_type||"page",L=inbound_settings.post_id||0;search_data={},formData={action:"inbound_lead_store",email:m,full_name:p,first_name:h,last_name:v,raw_params:f,mapped_params:g,url_params:JSON.stringify(y),search_data:"test",page_views:JSON.stringify(b),post_type:I,page_id:L,variation:C,source:t.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:S,inbound_nonce:inbound_settings.ajax_nonce,event:n},callback=function(o){e.deBugger("forms","Lead Created with ID: "+o),o=parseInt(o,10),formData.leadID=o,o&&(t.createCookie("wp_lead_id",o),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(n)},e.trigger("form_before_submission",formData),t.ajaxPost(inbound_settings.admin_url,formData,callback)},saveSearchData:function(n){for(var o=o||{},i=0;i<n.elements.length;i++)if(formInput=n.elements[i],multiple=!1,formInput.name){if(formInput.dataset.ignoreFormField){e.deBugger("searches","ignore "+formInput.name);continue}switch(inputName=formInput.name.replace(/\[([^\[]*)\]/g,"%5B%5D$1"),o[inputName]||(o[inputName]={}),formInput.type&&(o[inputName].type=formInput.type),o[inputName].name||(o[inputName].name=formInput.name),formInput.dataset.mapFormField&&(o[inputName].map=formInput.dataset.mapFormField),formInput.nodeName){case"INPUT":if(!1===(r=this.getInputValue(formInput)))continue;break;case"TEXTAREA":r=formInput.value;break;case"SELECT":if(formInput.multiple){values=[],multiple=!0;for(var a=0;a<formInput.length;a++)formInput[a].selected&&values.push(encodeURIComponent(formInput[a].value))}else r=formInput.value}if(e.deBugger("searches","Input Value = "+r),r){o[inputName].value||(o[inputName].value=[]),o[inputName].value.push(multiple?values.join(","):encodeURIComponent(r));var r=multiple?values.join(","):encodeURIComponent(r)}}e.deBugger("searches",o);var s=[];for(var l in o){var u=o[l].value,d=o[l].type;void 0!==u&&null!=u&&""!=u&&"search"==d&&s.push("search_text|value|"+o[l].value)}if(s[0]){var c=s.join("|field|");if(e.deBugger("searches","Stringified Search Form PARAMS: "+c),"undefined"!=typeof landing_path_info)m=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)m=cta_path_info.variation;else var m=inbound_settings.variation_id;var f=inbound_settings.post_type||"page",g=inbound_settings.post_id||0,p=t.readCookie("wp_lead_uid");inbound_settings.wp_lead_data.lead_email?email=inbound_settings.wp_lead_data.lead_email:t.readCookie("inbound_wpleads_email_address")?email=t.readCookie("inbound_wpleads_email_address"):email="",searchData={email:email,search_data:c,user_UID:p,post_type:f,page_id:g,variation:m,source:t.readCookie("inbound_referral_site"),ip_address:inbound_settings.ip_address,timestamp:Math.floor((new Date).getTime()/1e3)},e.trigger("search_before_caching",searchData),inbound_settings.wp_lead_data.lead_id?(searchData.lead_id=inbound_settings.wp_lead_data.lead_id,t.cacheSearchData(searchData,n)):t.cacheSearchData(searchData,n)}},rememberInputValues:function(n){n.name&&n.name;var o=n.type?n.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o||n.dataset.ignoreFormField)return!1;t.addListener(n,"change",function(n){if(n.target.name){if("checkbox"!==o)var i=n.target.value;else for(var a=[],r=document.querySelectorAll('input[name="'+n.target.name+'"]'),s=0;s<r.length;s++)r[s].checked&&a.push(r[s].value),i=a.join(",");inputData={name:n.target.name,node:n.target.nodeName.toLowerCase(),type:o,value:i,mapping:n.target.dataset.mapFormField},e.trigger("form_input_change",inputData),t.createCookie("inbound_"+n.target.name,encodeURIComponent(i))}})},fillInputValues:function(e){var n=e.name?"inbound_"+e.name:"",o=e.type?e.type:"text";if("submit"===o||"hidden"===o||"file"===o||"password"===o)return!1;if(t.readCookie(n)&&"comment"!=n)if(value=decodeURIComponent(t.readCookie(n)),"checkbox"===o||"radio"===o)for(var i=value.split(","),a=0;a<i.length;a++)e.value.indexOf(i[a])>-1&&(e.checked=!0);else"undefined"!==value&&(e.value=value)},getInputLabel:function(e){var t;return(t=this.siblingsIsLabel(e))?t:!!(t=this.CheckParentForLabel(e))&&t},getInputValue:function(e){var t=!1;switch(e.type){case"radio":case"checkbox":e.checked&&(t=e.value);break;case"text":case"hidden":default:t=e.value}return t},addDataAttr:function(e,t){for(var n=document.getElementsByName(e.name),o=n.length-1;o>=0;o--)e.dataset.mapFormField||(n[o].dataset.mapFormField=t)},removeArrayItem:function(e,t){if(e.indexOf)index=e.indexOf(t);else for(index=e.length-1;index>=0&&e[index]!==t;--index);index>=0&&e.splice(index,1)},siblingsIsLabel:function(e){for(var t=this.getSiblings(e),n=[],o=t.length-1;o>=0;o--)"label"===t[o].nodeName.toLowerCase()&&n.push(t[o]);return n.length>0&&n.length<2&&n},getChildren:function(e,t){for(var n=[];e;e=e.nextSibling)1==e.nodeType&&e!=t&&n.push(e);return n},getSiblings:function(e){return this.getChildren(e.parentNode.firstChild,e)},CheckParentForLabel:function(e){if("FORM"===e.nodeName)return null;do{var t=e.getElementsByTagName("label");if(t.length>0&&t.length<2)return e.getElementsByTagName("label")}while(e=e.parentNode);return null},mailCheck:function(){var e=document.querySelector(".inbound-email");e&&(t.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(n){var o=document.querySelector(".email_suggestion");o&&t.removeElement(o);var i=document.createElement("span");i.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+n.full+"</b></i>?</span>",e.parentNode.insertBefore(i,e.nextSibling);var a=document.getElementById("email_correction");t.addListener(a,"click",function(){e.value=a.innerHTML,a.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},void 0===u)var u={domainThreshold:1,topLevelThreshold:3,defaultDomains:["yahoo.com","google.com","hotmail.com","gmail.com","me.com","aol.com","mac.com","live.com","comcast.net","googlemail.com","msn.com","hotmail.co.uk","yahoo.co.uk","facebook.com","verizon.net","sbcglobal.net","att.net","gmx.com","mail.com","outlook.com","icloud.com"],defaultTopLevelDomains:["co.jp","co.uk","com","net","org","info","edu","gov","mil","ca","de"],run:function(e){e.domains=e.domains||u.defaultDomains,e.topLevelDomains=e.topLevelDomains||u.defaultTopLevelDomains,e.distanceFunction=e.distanceFunction||u.sift3Distance;var t=function(e){return e},n=e.suggested||t,o=e.empty||t,i=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return i?n(i):o()},suggest:function(e,t,n,o){e=e.toLowerCase();var i=this.splitEmail(e),a=this.findClosestDomain(i.domain,t,o,this.domainThreshold);if(a){if(a!=i.domain)return{address:i.address,domain:a,full:i.address+"@"+a}}else{var r=this.findClosestDomain(i.topLevelDomain,n,o,this.topLevelThreshold);if(i.domain&&r&&r!=i.topLevelDomain){var s=i.domain;return a=s.substring(0,s.lastIndexOf(i.topLevelDomain))+r,{address:i.address,domain:a,full:i.address+"@"+a}}}return!1},findClosestDomain:function(e,t,n,o){o=o||this.topLevelThreshold;var i,a=99,r=null;if(!e||!t)return!1;n||(n=this.sift3Distance);for(var s=0;s<t.length;s++){if(e===t[s])return e;(i=n(e,t[s]))<a&&(a=i,r=t[s])}return a<=o&&null!==r&&r},sift3Distance:function(e,t){if(null===e||0===e.length)return null===t||0===t.length?0:t.length;if(null===t||0===t.length)return e.length;for(var n=0,o=0,i=0,a=0;n+o<e.length&&n+i<t.length;){if(e.charAt(n+o)==t.charAt(n+i))a++;else{o=0,i=0;for(var r=0;r<5;r++){if(n+r<e.length&&e.charAt(n+r)==t.charAt(n)){o=r;break}if(n+r<t.length&&e.charAt(n)==t.charAt(n+r)){i=r;break}}}n++}return(e.length+t.length)/2-a},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(a=0;a<t.length;a++)if(""===t[a])return!1;var n=t.pop(),o=n.split("."),i="";if(0===o.length)return!1;if(1==o.length)i=o[0];else{for(var a=1;a<o.length;a++)i+=o[a]+".";o.length>=2&&(i=i.substring(0,i.length-1))}return{topLevelDomain:i,domain:n,address:t.join("@")}},encodeEmail:function(e){var t=encodeURI(e);return t=t.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};return e}(_inbound||{}),_inboundEvents=function(e){function t(t,o,i){var o=o||{};(i=i||{}).bubbles=i.bubbles||!0,i.cancelable=i.cancelable||!0,o=e.apply_filters("filter_"+t,o);!window.ActiveXObject&&window;if("function"==typeof CustomEvent)var a=new CustomEvent(t,{detail:o,bubbles:i.bubbles,cancelable:i.cancelable});else(a=document.createEvent("Event")).initEvent(t,!0,!0);window.dispatchEvent(a),e.do_action(t,o),n(t,o)}function n(e,t){if(window.jQuery){var t=t||{};jQuery(document).trigger(e,t)}}e.trigger=function(t,n){e.Events[t](n)};return e.Events={analytics_ready:function(){t("analytics_ready",{data:"xyxy"},{opt1:!0})},url_parameters:function(e){t("url_parameters",e)},session_start:function(){console.log(""),t("session_start")},session_end:function(e){t("session_end",e),console.log("Session End")},session_active:function(){t("session_active")},session_idle:function(e){t("session_idle",e)},session_resume:function(){t("session_resume")},session_heartbeat:function(e){t("session_heartbeat",{clock:e,leadData:InboundLeadData})},page_visit:function(e){t("page_view",e)},page_first_visit:function(n){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);e.deBugger("pages",status,function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")})},tab_hidden:function(n){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(n){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(n){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){e.deBugger("forms","inputData change. Data=",function(){console.log(n)}),t("form_input_change",n)},form_before_submission:function(e){t("form_before_submission",e)},form_after_submission:function(e){t("form_after_submission",e)},search_before_caching:function(e){t("search_before_caching",e)},analyticsError:function(e,t,n){var o=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(o),console.log("Page Save Error")}},e}(_inbound||{});_inbound.add_action("form_before_submission",inboundFormNoRedirect,10),_inbound.add_action("form_after_submission",inboundFormNoRedirectContent,10);var InboundTotalStorage=function(e){var t,n;if("localStorage"in window)try{n=void 0===window.localStorage?void 0:window.localStorage,t=void 0!==n&&void 0!==window.JSON,window.localStorage.setItem("_inbound","1"),window.localStorage.removeItem("_inbound")}catch(e){t=!1}e.totalStorage=function(t,n,o){return e.totalStorage.impl.init(t,n)},e.totalStorage.setItem=function(t,n){return e.totalStorage.impl.setItem(t,n)},e.totalStorage.getItem=function(t){return e.totalStorage.impl.getItem(t)},e.totalStorage.getAll=function(){return e.totalStorage.impl.getAll()},e.totalStorage.deleteItem=function(t){return e.totalStorage.impl.deleteItem(t)},e.totalStorage.impl={init:function(e,t){return void 0!==t?this.setItem(e,t):this.getItem(e)},setItem:function(o,i){if(!t)try{return e.Utils.createCookie(o,i),i}catch(e){console.log("Local Storage not supported by this browser. Install the cookie plugin on your site to take advantage of the same functionality. You can get it at https://github.com/carhartl/jquery-cookie")}var a=JSON.stringify(i);return n.setItem(o,a),this.parseResult(a)},getItem:function(o){if(!t)try{return this.parseResult(e.Utils.readCookie(o))}catch(e){return null}var i=n.getItem(o);return this.parseResult(i)},deleteItem:function(o){if(!t)try{return e.Utils.eraseCookie(o,null),!0}catch(e){return!1}return n.removeItem(o),!0},getAll:function(){var o=[];if(t)for(var i in n)i.length&&o.push({key:i,value:this.parseResult(n.getItem(i))});else try{for(var a=document.cookie.split(";"),r=0;r<a.length;r++){var s=a[r].split("=")[0];o.push({key:s,value:this.parseResult(e.Utils.readCookie(s))})}}catch(e){return null}return o},parseResult:function(e){var t;try{void 0===(t=JSON.parse(e))&&(t=e),"true"==t&&(t=!0),"false"==t&&(t=!1),parseFloat(t)==t&&"object"!=typeof t&&(t=parseFloat(t))}catch(n){t=e}return t}}}(_inbound||{}),_inboundLeadsAPI=function(e){return e.LeadsAPI={init:function(){var t=e.Utils,n=(t.readCookie("wp_lead_uid"),t.readCookie("wp_lead_id"));t.readCookie("lead_data_expire")||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(t){var n=e.Utils.readCookie("wp_lead_id"),o=e.totalStorage("inbound_lead_data"),i=e.Utils.readCookie("lead_data_expire");data={action:"inbound_get_all_lead_data",wp_lead_id:n},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var o=new Date;o.setTime(o.getTime()+18e5);var i=e.Utils.addDays(o,3);e.Utils.createCookie("lead_data_expire",!0,i)},o?(e.LeadsAPI.setGlobalLeadData(o),e.deBugger("lead","Set Global Lead Data from Localstorage"),i||(e.Utils.ajaxPost(inbound_settings.admin_url,data,success),e.deBugger("lead","localized data old. Pull new from DB"))):e.Utils.ajaxPost(inbound_settings.admin_url,data,success)},getLeadLists:function(){var t={action:"wpl_check_lists",wp_lead_id:e.Utils.readCookie("wp_lead_id")};e.Utils.ajaxPost(inbound_settings.admin_url,t,function(t){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")})}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,o=!1,i=!1,a=!1,r=parseInt(e.Utils.readCookie("lead_session"),10)||0,s=0,l=(new Date,null),u=null,d=null,c=e.Utils,m=e.Utils.GetDate(),f="page_views",g=e.totalStorage(f)||{},p=inbound_settings.post_id||window.location.pathname,h=e.Settings.timeout||1e4;return e.PageTracking={init:function(o){this.CheckTimeOut(),o=o||{},t=parseInt(o.reportInterval,10)||10,n=parseInt(o.idleTimeout,10)||3,c.addListener(document,"keydown",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(document,"click",c.throttle(e.PageTracking.pingSession,1e3)),c.addListener(window,"mousemove",c.throttle(e.PageTracking.pingSession,1e3)),e.PageTracking.checkVisibility(),this.startSession()},setIdle:function(t){var n="Session IDLE. Activity Timeout due to "+(t=t||"No Movement");e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n;void 0!==document.hidden?(t="hidden",n="visibilitychange"):void 0!==document.mozHidden?(t="mozHidden",n="mozvisibilitychange"):void 0!==document.msHidden?(t="msHidden",n="msvisibilitychange"):void 0!==document.webkitHidden&&(t="webkitHidden",n="webkitvisibilitychange");var o=document[t];e.Utils.addListener(document,n,function(n){o!=document[t]&&(document[t]?(e.trigger("tab_hidden"),e.PageTracking.setIdle("browser tab switch")):(e.trigger("tab_visible"),e.PageTracking.pingSession()),o=document[t])})},clock:function(){var n="Total time spent on Page in this Session: "+((r+=1)/60).toFixed(2)+" min";if(e.deBugger("pages",n),r>0&&r%t==0){var o=new Date;o.setTime(o.getTime()+18e5),c.createCookie("lead_session",r,o),e.trigger("session_heartbeat",r)}},inactiveClock:function(){var t="Time until Session Timeout: "+((1800-(s+=1))/60).toFixed(2)+" min";e.deBugger("pages",t),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){i=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){i=!1,e.trigger("session_resume"),e.deBugger("pages","Activity resumed. Session Active"),clearTimeout(l),s=0,clearTimeout(u),l=setInterval(e.PageTracking.clock,1e3)},turnOff:function(){e.PageTracking.setIdle(),a=!0},turnOn:function(){a=!1},startSession:function(){new Date;if(o=!0,l=setInterval(e.PageTracking.clock,1e3),c.readCookie("lead_session"))e.trigger("session_active");else{e.trigger("session_start");var t=new Date;t.setTime(t.getTime()+18e5),e.Utils.createCookie("lead_session",1,t)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){a||(o||e.PageTracking.startSession(),i&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),void 0!==t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){if(e.Utils.checkLocalStorage()){var t=localStorage.getItem(f),n=JSON.parse(t);return n}},isRevisit:function(e){var t=!1,n=(e=e||{})[p];return void 0!==n&&null!==n&&(t=!0),t},triggerPageView:function(t){var n={title:document.title,url:document.location.href,path:document.location.pathname,count:1};t?(g[p].push(m),n.count=g[p].length,e.trigger("page_revisit",n)):(g[p]=[],g[p].push(m),e.trigger("page_first_visit",n)),e.trigger("page_visit",n),e.totalStorage(f,g),this.storePageView()},CheckTimeOut:function(){var t,n=this.isRevisit(g);if(n){var o=g[p].length-1,i=g[p][o],a=Math.abs(new Date(i).getTime()-new Date(m).getTime());a>h?(t="Timeout Happened. Page view fired",this.triggerPageView(n)):(time_left=.001*Math.abs(h-a),t=h/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(n);e.deBugger("pages",t)},storePageView:function(){var t=!1;"off"==inbound_settings.page_tracking&&"landing-page"!=inbound_settings.post_type||(document.onreadystatechange=function(){"loading"!==document.readyState&&!1===t&&setTimeout(function(){var n=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",o=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",i=e.totalStorage("wp_cta_loaded"),a=e.totalStorage("wp_cta_impressions");t=!0,e.totalStorage("wp_cta_impressions",{});var r={action:"inbound_track_lead",wp_lead_uid:o,wp_lead_id:n,page_id:inbound_settings.post_id,variation_id:inbound_settings.variation_id,post_type:inbound_settings.post_type,current_url:window.location.href,page_views:JSON.stringify(e.PageTracking.getPageViews()),cta_impressions:JSON.stringify(a),cta_history:JSON.stringify(i),json:"0"};e.Utils.ajaxPost(inbound_settings.admin_url,r,function(e){})},200)})}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
shared/classes/class.events.php CHANGED
@@ -510,6 +510,78 @@ class Inbound_Events {
510
  }
511
  }
512
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
  /**
514
  * Get all Inbound Form submission events related to lead ID
515
  */
@@ -1209,6 +1281,20 @@ class Inbound_Events {
1209
  return $results;
1210
  }
1211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1212
  /**
1213
  * Get all unsubscribe events given a lead id
1214
  */
510
  }
511
  }
512
 
513
+ /**
514
+ * Checks to see if lead has viewed a page
515
+ * @param $args
516
+ * @return BOOL
517
+ */
518
+ public static function check_page_view( $args ) {
519
+ global $wpdb;
520
+
521
+ $args['lead_id'] = (isset($args['lead_id'])) ? $args['lead_id'] : 0;
522
+ $args['page_id'] = (isset($args['page_id'])) ? $args['page_id'] : 0;
523
+
524
+ if(!$args['lead_id']) {
525
+ return;
526
+ }
527
+
528
+ $table_name = $wpdb->prefix . "inbound_page_views";
529
+
530
+ $query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$args['lead_id'].'" AND `page_id` = "'.$args['page_id'].'"';
531
+
532
+ $results = $wpdb->get_results( $query , ARRAY_A );
533
+
534
+ return (count($results)>0) ? $results[0]['page_id'] : false;
535
+ }
536
+
537
+ /**
538
+ * Checks to see if lead has opened an email
539
+ * @param $args
540
+ * @return BOOL
541
+ */
542
+ public static function check_email_open( $args ) {
543
+ global $wpdb;
544
+
545
+ $args['lead_id'] = (isset($args['lead_id'])) ? $args['lead_id'] : 0;
546
+ $args['email_id'] = (isset($args['email_id'])) ? $args['email_id'] : 0;
547
+
548
+ if(!$args['lead_id']) {
549
+ return;
550
+ }
551
+
552
+ $table_name = $wpdb->prefix . "inbound_events";
553
+
554
+ $query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$args['lead_id'].'" AND `email_id` = "'.$args['email_id'].'" AND `event_name` LIKE "%_open%"';
555
+
556
+ $results = $wpdb->get_results( $query , ARRAY_A );
557
+
558
+ return (count($results)>0) ? $results[0]['email_id'] : false;
559
+ }
560
+
561
+ /**
562
+ * Checks to see if lead has opened an email
563
+ * @param $args
564
+ * @return BOOL
565
+ */
566
+ public static function check_cta_click( $args ) {
567
+ global $wpdb;
568
+
569
+ $args['lead_id'] = (isset($args['lead_id'])) ? $args['lead_id'] : 0;
570
+ $args['cta_id'] = (isset($args['cta_id'])) ? $args['cta_id'] : 0;
571
+
572
+ if(!$args['lead_id']) {
573
+ return;
574
+ }
575
+
576
+ $table_name = $wpdb->prefix . "inbound_events";
577
+
578
+ $query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$args['lead_id'].'" AND `cta_id` = "'.$args['cta_id'].'" AND `event_name` = "inbound_cta_click"';
579
+
580
+ $results = $wpdb->get_results( $query , ARRAY_A );
581
+
582
+ return (count($results)>0) ? $results[0]['cta_id'] : false;
583
+ }
584
+
585
  /**
586
  * Get all Inbound Form submission events related to lead ID
587
  */
1281
  return $results;
1282
  }
1283
 
1284
+ /**
1285
+ * Agnosticly et all email click events related to lead ID
1286
+ */
1287
+ public static function get_all_email_opens( $lead_id ){
1288
+ global $wpdb;
1289
+
1290
+ $table_name = $wpdb->prefix . "inbound_events";
1291
+
1292
+ $query = 'SELECT * FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'" AND `event_name` LIKE "%_open" ORDER BY `datetime` DESC';
1293
+ $results = $wpdb->get_results( $query , ARRAY_A );
1294
+
1295
+ return $results;
1296
+ }
1297
+
1298
  /**
1299
  * Get all unsubscribe events given a lead id
1300
  */
shared/classes/class.inbound-api.php CHANGED
@@ -108,9 +108,6 @@ class Inbound_API {
108
  add_action('template_redirect', array(__CLASS__, 'process_api_query'), -1);
109
  add_action('template_redirect', array(__CLASS__, 'process_tracked_link'), -1);
110
 
111
- /* Listen for & execute api key commands */
112
- add_action('inbound_process_api_key', array(__CLASS__, 'process_api_key'));
113
-
114
  /* Determine if JSON_PRETTY_PRINT is available */
115
  self::$pretty_print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : null;
116
 
@@ -909,7 +906,6 @@ class Inbound_API {
909
  /**
910
  * Adds a lead to the wp-lead custom post type
911
  * @param ARRAY $params key/value pairs that will direct the building of WP_Query, optional
912
- * @global OBJECT $Inbound_Leads Inbound_Leads
913
  */
914
  public static function leads_add($params = array()) {
915
 
@@ -1397,7 +1393,7 @@ class Inbound_API {
1397
  $lead_id_cookie = (isset($_COOKIE['wp_lead_id'])) ? $_COOKIE['wp_lead_id'] : 0;
1398
 
1399
  /* if lead_id is set then apply it to 'id' */
1400
- $args['id'] = (isset($args['lead_id']) && $args['lead_id']) ? $args['lead_id'] : $args['id'];
1401
 
1402
  /* if no lead_id so far then fall back on cookie value */
1403
  $args['id'] = (isset($args['id']) && $args['id']) ? $args['id'] : $lead_id_cookie;
@@ -1409,6 +1405,10 @@ class Inbound_API {
1409
 
1410
  /* process extra lead events */
1411
  if ($args['id']) {
 
 
 
 
1412
  /* Add lead to lists */
1413
  if (isset($args['add_lists']) && self::validate_parameter($args['add_lists'], 'add_lists', 'array')) {
1414
  foreach ($args['add_lists'] as $list_id) {
@@ -1437,7 +1437,6 @@ class Inbound_API {
1437
  Inbound_Leads::remove_tag_from_lead($args['id'], $tag);
1438
  }
1439
  }
1440
-
1441
  }
1442
 
1443
  /* check for known bots and ignore */
108
  add_action('template_redirect', array(__CLASS__, 'process_api_query'), -1);
109
  add_action('template_redirect', array(__CLASS__, 'process_tracked_link'), -1);
110
 
 
 
 
111
  /* Determine if JSON_PRETTY_PRINT is available */
112
  self::$pretty_print = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : null;
113
 
906
  /**
907
  * Adds a lead to the wp-lead custom post type
908
  * @param ARRAY $params key/value pairs that will direct the building of WP_Query, optional
 
909
  */
910
  public static function leads_add($params = array()) {
911
 
1393
  $lead_id_cookie = (isset($_COOKIE['wp_lead_id'])) ? $_COOKIE['wp_lead_id'] : 0;
1394
 
1395
  /* if lead_id is set then apply it to 'id' */
1396
+ $args['id'] = (isset($args['lead_id']) && $args['lead_id']) ? $args['lead_id'] : 0;
1397
 
1398
  /* if no lead_id so far then fall back on cookie value */
1399
  $args['id'] = (isset($args['id']) && $args['id']) ? $args['id'] : $lead_id_cookie;
1405
 
1406
  /* process extra lead events */
1407
  if ($args['id']) {
1408
+
1409
+ /* create redundant key */
1410
+ $args['lead_id'] = $args['id'];
1411
+
1412
  /* Add lead to lists */
1413
  if (isset($args['add_lists']) && self::validate_parameter($args['add_lists'], 'add_lists', 'array')) {
1414
  foreach ($args['add_lists'] as $list_id) {
1437
  Inbound_Leads::remove_tag_from_lead($args['id'], $tag);
1438
  }
1439
  }
 
1440
  }
1441
 
1442
  /* check for known bots and ignore */
shared/classes/class.menus.adminbar.php CHANGED
@@ -114,7 +114,7 @@ class Inbound_Menus_Adminbar {
114
 
115
  foreach ($secondary_menu_items as $id => $menu_item) {
116
  $menu_item['id'] = $id;
117
- $menu_item['meta'] = (isset($menu_item['meta']) ) ? $menu_item['meta'] : array();
118
 
119
  if (!isset($menu_item['meta']['target'])) {
120
  $menu_item['meta']['target'] = '_blank';
114
 
115
  foreach ($secondary_menu_items as $id => $menu_item) {
116
  $menu_item['id'] = $id;
117
+ $menu_item['meta'] = (isset($menu_item['meta']) && is_array($menu_item['meta']) ) ? $menu_item['meta'] : array();
118
 
119
  if (!isset($menu_item['meta']['target'])) {
120
  $menu_item['meta']['target'] = '_blank';
shared/classes/class.shortcodes.email-template.php CHANGED
@@ -54,21 +54,25 @@ class Inbound_Email_Template_Shortcodes {
54
 
55
  $post_params['email'] = str_replace('%40', '@', $post_params['email']);
56
 
57
-
58
  /* add mapped params */
59
- parse_str($_POST['mapped_params'], $mapped_params);
60
- parse_str($_POST['raw_params'], $raw_params);
61
 
62
- foreach ($mapped_params as $key => $value) {
63
- $post_params = array($key => $value) + $post_params;
 
64
  }
65
 
66
- foreach ($raw_params as $key => $value) {
67
- if (!isset($post_params[$key])) {
68
- $post_params = $post_params + array($key => $value);
 
 
 
69
  }
70
  }
71
 
 
72
  /* filter params */
73
  $post_params = apply_filters('inbound_email_response/post_params', $post_params);
74
 
54
 
55
  $post_params['email'] = str_replace('%40', '@', $post_params['email']);
56
 
 
57
  /* add mapped params */
58
+ if (isset($_POST['mapped_params'])) {
59
+ parse_str($_POST['mapped_params'], $mapped_params);
60
 
61
+ foreach ($mapped_params as $key => $value) {
62
+ $post_params = array($key => $value) + $post_params;
63
+ }
64
  }
65
 
66
+ if (isset($_POST['raw_params'])) {
67
+ parse_str($_POST['raw_params'], $raw_params);
68
+ foreach ($raw_params as $key => $value) {
69
+ if (!isset($post_params[$key])) {
70
+ $post_params = $post_params + array($key => $value);
71
+ }
72
  }
73
  }
74
 
75
+
76
  /* filter params */
77
  $post_params = apply_filters('inbound_email_response/post_params', $post_params);
78
 
templates/simple-two-column/assets/css/style.css CHANGED
@@ -1,119 +1,146 @@
 
 
 
 
1
 
 
 
 
2
 
3
- @media handheld, screen and (max-width: 600px) {
4
- #content-wrapper {
5
- width:100% !important;
6
- }
7
- .contatiner {
8
- width:100% !important;
9
- }
10
- #left {
11
- float: none !important;
12
- width:100% !important;
13
- position:initial !important;
14
- height:auto !important;
15
- }
16
- #right {
17
- float: none !important;
18
- width:100% !important;
19
- position:initial !important;
20
- height:auto !important;
21
- }
22
  }
23
 
24
  body {
25
- margin:0px; background-color: #06266F
 
26
  }
27
 
28
  .container {
29
- margin-right: auto;
30
- margin-left: auto;
31
- width: 980px;
32
- font-family: 'Open Sans', sans-serif;
33
  }
 
34
  #div-before, #div-after {
35
- background-color: #88D;
36
- color: black;
37
  }
38
- #content-wrapper {
39
- position: absolute;
40
- height: 100%;
41
 
42
- }
43
  #content-wrapper {
44
- width: 980px;
45
- background-color: black;
46
- color: white;
 
 
 
 
 
 
47
  }
 
48
  #content-wrapper-padding {
49
- padding: 10px;
50
  }
 
51
  #right {
52
- position: absolute;
53
- top: 0;
54
- right: 0;
55
- height: 100%;
56
- width: 33.33%;
57
  }
 
58
  #right {
59
- background-color: #2A4480;
60
- color: white;
61
 
62
- /* -9px 0px 10px rgba(50, 50, 50, 0.55) */
63
- z-index: 999;
64
  }
 
65
  #right-content {
66
- padding: 30px;
67
- padding-top: 25px;
68
  }
 
69
  #left {
70
- position: absolute;
71
- top: 0;
72
- height: 100%;
73
- width: 66.66%;
74
  }
 
75
  #left-content {
76
- padding: 30px;
77
- padding-top: 20px;
78
- font-weight: 100;
 
 
 
 
79
  }
80
- #left-content h1 {margin-top: 0px;}
81
  #left {
82
- background-color: #1240AB;
83
- color: white;
 
 
 
 
84
  }
85
- #header {margin: 0px;}
86
  /* Form CSS */
87
- .lp-span {text-transform: none; display: block; margin-bottom: 8px;}
 
 
 
 
 
88
  .lp-input-label .lp-span {
89
- display: inline;
90
- color:red;
91
- }
92
- input[type="text"], input[type="email"], #inbound-form-wrapper input[type=text], #inbound-form-wrapper input[type=url], #inbound-form-wrapper input[type=email], #inbound-form-wrapper input[type=tel], #inbound-form-wrapper input[type=number], #inbound-form-wrapper input[type=password] , #inbound-form-wrapper select {
93
- width: 94%;
94
- padding: 8px 4px 8px 10px;
95
- margin-bottom: 15px;
96
- border: 1px solid #4E3043;
97
- border: 1px solid rgba(0, 0, 0, 0.8);
98
- background: rgba(0, 0, 0, 0.15);
99
- border-radius: 2px;
100
- box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 1px 1px rgba(0, 0, 0, 0.1);
101
- -webkit-transition: all 0.3s ease-out;
102
- -moz-transition: all 0.3s ease-out;
103
- -ms-transition: all 0.3s ease-out;
104
- -o-transition: all 0.3s ease-out;
105
- transition: all 0.3s ease-out;
106
- font-family: 'Raleway', 'Lato', Arial, sans-serif;
107
- color: white;
108
- font-size: 13px; /*
109
-
110
- display: block;
111
- padding: 5px;
112
- border: 4px solid #F1B720;
113
- border-radius: 5px;
114
- color: #333;
115
- transition: all 0.3s ease-out; */
116
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  /*
118
  input[type="text"]:hover { border-radius: 8px; }
119
  input[type="text"]:focus {
@@ -123,29 +150,29 @@ input[type="text"]:focus {
123
  }
124
  */
125
 
126
-
127
  input[type="submit"], button[type="submit"] {
128
- width: 100%;
129
- padding: 8px 5px;
130
- background: #11b709;
131
- background: -moz-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
132
- background: -ms-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
133
- background: -o-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
134
- background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(17, 183, 9, 0.5)), to(rgba(17, 183, 9, 0.7)));
135
- background: -webkit-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
136
- background: linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
137
- border: 1px solid black;
138
- border-radius: 5px;
139
- box-shadow: inset 0 1px rgba(255, 255, 255, 0.4), 0 2px 1px rgba(0, 0, 0, 0.1);
140
- cursor: pointer;
141
- -webkit-transition: all 0.3s ease-out;
142
- -moz-transition: all 0.3s ease-out;
143
- -ms-transition: all 0.3s ease-out;
144
- -o-transition: all 0.3s ease-out;
145
- transition: all 0.3s ease-out;
146
- color: white;
147
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
148
- font-size: 22px;
149
- font-weight: bold;
150
- font-family: 'Raleway', 'Lato', Arial, sans-serif;
151
- }
 
1
+ @media handheld, screen and (max-width: 600px) {
2
+ #content-wrapper {
3
+ width: 100% !important;
4
+ }
5
 
6
+ .contatiner {
7
+ width: 100% !important;
8
+ }
9
 
10
+ #left {
11
+ float: none !important;
12
+ width: 100% !important;
13
+ position: initial !important;
14
+ height: auto !important;
15
+ }
16
+
17
+ #right {
18
+ float: none !important;
19
+ width: 100% !important;
20
+ position: initial !important;
21
+ height: auto !important;
22
+ }
 
 
 
 
 
 
23
  }
24
 
25
  body {
26
+ margin: 0px;
27
+ background-color: #06266F
28
  }
29
 
30
  .container {
31
+ margin-right: auto;
32
+ margin-left: auto;
33
+ width: 980px;
34
+ font-family: 'Open Sans', sans-serif;
35
  }
36
+
37
  #div-before, #div-after {
38
+ background-color: #88D;
39
+ color: black;
40
  }
 
 
 
41
 
 
42
  #content-wrapper {
43
+ position: absolute;
44
+ height: 100%;
45
+ width: 980px;
46
+ background-color: black;
47
+ color: white;
48
+ }
49
+ #content-wrapper img{
50
+ max-width: 100%;
51
+ height:auto;
52
  }
53
+
54
  #content-wrapper-padding {
55
+ padding: 10px;
56
  }
57
+
58
  #right {
59
+ position: absolute;
60
+ top: 0;
61
+ right: 0;
62
+ height: 100%;
63
+ width: 33.33%;
64
  }
65
+
66
  #right {
67
+ background-color: #2A4480;
68
+ color: white;
69
 
70
+ /* -9px 0px 10px rgba(50, 50, 50, 0.55) */
71
+ z-index: 999;
72
  }
73
+
74
  #right-content {
75
+ padding: 30px;
76
+ padding-top: 25px;
77
  }
78
+
79
  #left {
80
+ position: absolute;
81
+ top: 0;
82
+ height: 100%;
83
+ width: 66.66%;
84
  }
85
+
86
  #left-content {
87
+ padding: 30px;
88
+ padding-top: 20px;
89
+ font-weight: 100;
90
+ }
91
+
92
+ #left-content h1 {
93
+ margin-top: 0px;
94
  }
95
+
96
  #left {
97
+ background-color: #1240AB;
98
+ color: white;
99
+ }
100
+
101
+ #header {
102
+ margin: 0px;
103
  }
104
+
105
  /* Form CSS */
106
+ .lp-span {
107
+ text-transform: none;
108
+ display: block;
109
+ margin-bottom: 8px;
110
+ }
111
+
112
  .lp-input-label .lp-span {
113
+ display: inline;
114
+ color: red;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  }
116
+
117
+ input[type="text"], input[type="email"], #inbound-form-wrapper input[type=text], #inbound-form-wrapper input[type=url], #inbound-form-wrapper input[type=email], #inbound-form-wrapper input[type=tel], #inbound-form-wrapper input[type=number], #inbound-form-wrapper input[type=password], #inbound-form-wrapper select {
118
+ width: 94%;
119
+ padding: 8px 4px 8px 10px;
120
+ margin-bottom: 15px;
121
+ border: 1px solid #4E3043;
122
+ border: 1px solid rgba(0, 0, 0, 0.8);
123
+ background: rgba(0, 0, 0, 0.15);
124
+ border-radius: 2px;
125
+ box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 1px 1px rgba(0, 0, 0, 0.1);
126
+ -webkit-transition: all 0.3s ease-out;
127
+ -moz-transition: all 0.3s ease-out;
128
+ -ms-transition: all 0.3s ease-out;
129
+ -o-transition: all 0.3s ease-out;
130
+ transition: all 0.3s ease-out;
131
+ font-family: 'Raleway', 'Lato', Arial, sans-serif;
132
+ color: white;
133
+ font-size: 13px;
134
+ /*
135
+
136
+ display: block;
137
+ padding: 5px;
138
+ border: 4px solid #F1B720;
139
+ border-radius: 5px;
140
+ color: #333;
141
+ transition: all 0.3s ease-out; */
142
+ }
143
+
144
  /*
145
  input[type="text"]:hover { border-radius: 8px; }
146
  input[type="text"]:focus {
150
  }
151
  */
152
 
 
153
  input[type="submit"], button[type="submit"] {
154
+ width: 100%;
155
+ padding: 8px 5px;
156
+ background: #11b709;
157
+ background: -moz-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
158
+ background: -ms-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
159
+ background: -o-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
160
+ background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(17, 183, 9, 0.5)), to(rgba(17, 183, 9, 0.7)));
161
+ background: -webkit-linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
162
+ background: linear-gradient(rgba(17, 183, 9, 0.5), rgba(17, 183, 9, 0.7));
163
+ border: 1px solid black;
164
+ border-radius: 5px;
165
+ box-shadow: inset 0 1px rgba(255, 255, 255, 0.4), 0 2px 1px rgba(0, 0, 0, 0.1);
166
+ cursor: pointer;
167
+ -webkit-transition: all 0.3s ease-out;
168
+ -moz-transition: all 0.3s ease-out;
169
+ -ms-transition: all 0.3s ease-out;
170
+ -o-transition: all 0.3s ease-out;
171
+ transition: all 0.3s ease-out;
172
+ color: white;
173
+ text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
174
+ font-size: 22px;
175
+ font-weight: bold;
176
+ font-family: 'Raleway', 'Lato', Arial, sans-serif;
177
+ }
178
+