WordPress Landing Pages - Version 2.3.8

Version Description

  • Improving events storage and events reporting.
Download this release

Release Info

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

Code changes from version 2.3.7 to 2.3.8

README.md CHANGED
@@ -66,294 +66,3 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
66
*Can I create my own landing page designs?,
67
*Yes! You can learn how to <a href="http://docs.inboundnow.com/guide/creating-landing-page-templates/">create your own landing page template here</a>.
68
69
- ## Screenshots ##
70
-
71
- ### 1. Landing Page Custom Post Type ###
72
- ![Landing Page Custom Post Type](screenshot-1.jpg)
73
-
74
- ### 2. Track conversion rates and continuously improve your landing pages ###
75
- ![Track conversion rates and continuously improve your landing pages](screenshot-2.jpg)
76
-
77
- ### 3. Manage Split Testing Page ###
78
- ![Manage Split Testing Page](screenshot-3.jpg)
79
-
80
- ### 4. Choose from a ton of pre-made templates, use your existing design, or design your own theme! ###
81
- ![Choose from a ton of pre-made templates, use your existing design, or design your own theme!](screenshot-4.jpg)
82
-
83
-
84
- ## Changelog ##
85
- ### 1.8.0 ###
86
- * Fixing addon store
87
-
88
- ### 1.7.9 ###
89
- * Even more security updates! Security for the win!
90
-
91
- ### 1.7.8 ###
92
- * Security Patch
93
-
94
- ### 1.7.7 ###
95
- * Fix double lead notification email
96
-
97
- ### 1.7.6 ###
98
- * Fixed double email submission on contact form 7
99
-
100
- ### 1.7.5 ###
101
- * Added form field exclusions to ignore sensitive data
102
-
103
- ### 1.7.3 ###
104
- * See changelog here: https://github.com/inboundnow/landing-pages/issues?q=is%3Aissue+is%3Aclosed+label%3Av1.7.3
105
-
106
- ### 1.7.2 ###
107
- * Improved form email typo detection
108
- * Improved Template Styles
109
- * Fixed content wysiwyg scroll freezing bug
110
-
111
- ### 1.7.1 ###
112
- * removed iframe of inbound now addon store. For addons please visit: http://inboundnow.com/market
113
-
114
- ### 1.7.0 ###
115
- * Removed anonymous PHP functions for PHP 5.2 support
116
- * Updated template creation standards
117
- * Converted varition modules to CLASS based system & documented
118
- * Move /lang/ file outside of shared
119
-
120
- ### 1.6.2 ###
121
- * Bug Fix: Fix with lead email notifications
122
-
123
- ### 1.5.9 ###
124
- * Various bug fixes.
125
- * Refactored main plugin file to class loader.
126
- * Improved localization systems.
127
-
128
- ### 1.5.8 ###
129
- * Bug Fix: Check all required fields
130
-
131
- ### 1.5.7 ###
132
- * Improvement: All core template now use new consolidated settings system.
133
- * Improvement: Leads Dashboard styling & stats
134
- * Improvement: Screenshots on local installation replaced with template thumbnails.
135
-
136
-
137
- ### 1.5.6 ###
138
- * Fix to insert marketing shortcode popup
139
-
140
- ### 1.5.5 ###
141
- * Added events to lead tracking
142
- * Bug Fix: Marketing Button
143
- * Optimized CTA Tracking JS.
144
- * Expanded impression/conversion analytics to all post types.
145
-
146
- ### 1.5.4 ###
147
- * Impression tracking bug fix.
148
- * Bringing Inbound Tracking to All Posts/Pages
149
-
150
- ### 1.5.3 ###
151
- * Temporary fix for shortcodes disappearing from wordpress 3.8 to 3.9
152
- * Performance improvements on analytics and lead tracking
153
-
154
- ### 1.5.1 ###
155
- * Misc bug fixes
156
-
157
- ### 1.5.0 ###
158
- * fixed field mapping bug
159
- * Added better compability for js conflicts
160
- * Prepping for marketing automation
161
-
162
- ### 1.4.9 ###
163
- * Fixed and improved default landing page templates
164
- * Updates to work with V2 of the CTA plugins
165
- * Improved form compatibilty with contact form 7, gravity forms, and ninja forms
166
- * Numerous bug files and code improvements
167
-
168
- ### 1.4.8 ###
169
- * Added Google Analytics Custom Event Tracking for form submissions
170
- * Added Ability: automatically sort leads into lists on form completions
171
- * Added Ability: Send lead notification emails to multiple people. Use comma separated values
172
- * Improved Social Media Buttons called with lp_social_media() function
173
- * Fixed qTranslate plugin bug
174
- * Fixed Genesis Title tag conflict
175
- * Added improved asset loader
176
- * Updated main docs.inboundnow.com site. Check it out!
177
-
178
- ### 1.4.7 ###
179
- * GPL fix with js library
180
-
181
- ### 1.4.6 ###
182
- * New Feature: Bulk Lead management with leads plugin wordpress.org/plugins/leads/
183
- * Added tags to lead profiles for improved management/categorization
184
- * Added new compatibility options to fix third party plugin conflicts!
185
- * Added new debugging javascript debugging tools for users
186
- * Fixed Email Sending Error on forms
187
- * Improved support for master license keys
188
-
189
- ### 1.4.5 ###
190
- * Added New HTML Lead Email Template with clickable links for faster lead management
191
- * Added Button Shortcodes!
192
- * Added HTML field option to form tool
193
- * Added Divider Option to Form tool
194
- * Added multi column support to icon list shortcode
195
- * Added Font Awesome Icons option to Inbound Form Submit buttons
196
- * Added Social Sharing Shortcode
197
- * Bug fix - emails not sending after form conversion fixed
198
-
199
- ### 1.4.1 ###
200
- * Bug fix - missing trackingObj
201
-
202
- ### 1.4.0 ###
203
- * Added feature request form to all plugin admin pages. Submit your feature requests today! =)
204
-
205
- ### 1.3.9 ###
206
- * Bug fixes for form creation issues
207
- * Bug fixes for safari page tracking not firing
208
- * Added quick menu to WP admin bar for quicker marketing!
209
-
210
- ### 1.3.8 ###
211
- * Updated styles to 3.8 wordpress
212
- * Streamlined form creation
213
- * fixed rogue PHP errors
214
-
215
- ### 1.3.7 ###
216
- * Added: Shortcode now automatically render in landing page option echos in templates
217
- * Updated: Visual Editor tool
218
- * Updated: Template selection interface
219
- * Updated: Major updates to core templates, CSS tweaks and fixes
220
- * Fixed: Shortcode insert into correct editor box
221
- * Fixed: editor always on HTML view
222
-
223
- ### 1.3.6 ###
224
-
225
- * Added: New Shortcodes! Fancy List and Column shortcodes
226
- * Added: Added email confirmation support to Inbound Forms tool
227
- * Added: Added New Welcome Page with Tutorial Video on Getting Started
228
- * Added: New Debug Tab for faster support requests/debugging
229
- * Fixed: CSS conflicts with button classes
230
-
231
- ### 1.3.1 ###
232
-
233
- * Added: Added InboundNow form creation and management system (beta)
234
- * Added: Support for InboundNow cross plugin extensions
235
- * Added: 'Sticky Variations' to global settings.
236
- * Added: Easier way for extension developers to license their extensions.
237
- * Added: 'header' setting component to global settings.
238
- * Fixed: Security issues
239
- * Improvement: Improved data management for global settings, metaboxes, and extensions.
240
-
241
- ### 1.2.3 ###
242
-
243
- * Fixed: Security issue with vulnerability to sql injection.
244
-
245
- ### 1.2.1 ###
246
-
247
- * Fixed: Issues with shortcodes rendering in wp-admin for variations.
248
-
249
- ### 1.1.9 ###
250
-
251
- * Fixed: Issues with navigation menu items breaking on landing pages with the default template selected.
252
-
253
- ### 1.1.8 ###
254
-
255
- * Fixed: Issue with post_content not saving for variations.
256
- * Added: [lp_conversion_area] Shortcode. It renders form conversion area anywhere on landing page
257
- * Fixed: Restored the ability to delete custom templates from 'Templates' section.
258
-
259
- ### 1.1.7 ###
260
-
261
- * Fixed: Issue with extension license keys not validating
262
- * Fixed: Issue with shortcodes not firing on select core templates
263
- * Improvement: Converted global settings data array to new easier to read format for development, added in legacy support.
264
-
265
- ### 1.1.0.1 ###
266
-
267
- * Fixed: Variation saves for custom css and custom js.
268
- * Fixed: jQuery error related to wysiwyg content formatting.
269
-
270
- ### 1.0.9.9 ###
271
- * Improved extension metabox loading for quicker load times and optimized meta data storage.
272
- * Phased out more 'old method' split testing components.
273
- * Improved .htaccess parsing.
274
- * Addressed issue with line breaks being removed from WYSIWYG editors.
275
-
276
- ### 1.0.9.4 ###
277
- * Added in tours for the edit screen and the list of landing page screen for new users to learn how to use the tool quickly and easily
278
- * Updated conversion tracking for wp-leads addon plugin
279
- * Added in option for default templates to toggle on/off navigation
280
-
281
- ### 1.0.9.3 ###
282
-
283
- * Removed old A/B split testing and the new system is fully in place!
284
-
285
- ### 1.0.9.0 ###
286
-
287
- * Added in A/B stats to the main landing page list view
288
-
289
- ### 1.0.8.6 ###
290
-
291
- * Release new and improved version of A/B testing!
292
- * Ajax saving on landing page options for faster page edits
293
- * Frontend Visual Editor to see what you are editing/changing
294
- * Enabled frontend editor for use on normal pages and posts
295
-
296
- ### 1.0.8.5 ###
297
-
298
- Providing better conversion and impression tracking for landing pages that are set as homepage.
299
-
300
- ### 1.0.8.4 ###
301
-
302
- Fixing activation bug
303
-
304
- ### 1.0.8.1 ###
305
-
306
- Fixing issue with jquery submission errors.
307
-
308
- ### 1.0.7.9 ###
309
-
310
- Added capability to activate and update license keys for premium extensions. Added ability to define white listed HTML elements for Form Standardization process.
311
-
312
- ### 1.0.7.3 ###
313
-
314
- Fixed issue with WP_List_table causing posts to to save or edit propperly Attempt 001
315
-
316
- ### 1.0.7.1 ###
317
-
318
- Added cookie based auto-field population & lead data collection to core.
319
-
320
- ### 1.0.5.6 ###
321
-
322
- Fixed issue with global setting's radio buttons not holding new set values.
323
-
324
- ### 1.0.5.3 ###
325
-
326
- Solutions for custom post type wp rewrite issue on activation.
327
-
328
- ### 1.0.5.1 ###
329
-
330
- Introducing version control system for extensions.
331
-
332
- ### 1.0.4.4 ###
333
-
334
- Migrating store to new location. Updating version control systems
335
-
336
- ### 1.0.4.2 ###
337
-
338
- Added new defitions to form standardization parser. Limited .htaccess rewrites to plugin activation to try and mitigate .htaccess corruptions.
339
-
340
- ### 1.0.4.1 ###
341
-
342
- Fixed issue with conversions not recording on some servers by forcing form submittal to wait until ajax has completely finnished loading before continuing to process form.
343
-
344
- ### 1.0.3.9 ###
345
-
346
- Fixed issue with plugins and wp core refusing to update on some installations when landing page plugin is activated.
347
-
348
- ### 1.0.3.8 ###
349
-
350
- Debugging cross browser impressions and conversion tracking. Implemented soltion for url-to-postid conversions that's compatible with the /slug/ removal extension for landing pages plugin.
351
- Added email validation check to prevent false positives when form standardization is turned on.
352
-
353
- ### 1.0.3.7 ###
354
-
355
- **Bug Fix:** 'Clear Stats' button.
356
-
357
- ### 1.1 ###
358
-
359
- Released
66
*Can I create my own landing page designs?,
67
*Yes! You can learn how to <a href="http://docs.inboundnow.com/guide/creating-landing-page-templates/">create your own landing page template here</a>.
68
classes/class.template-management.php CHANGED
@@ -228,13 +228,13 @@ class Landing_Pages_Template_Management {
228
</ul>
229
230
<br class="clear">
231
- <h4><?php _e('Install Landing Pages template by uploading them here in .zip format' , 'landing-pages'); ?></h4>
232
233
- <p class="install-help"><?php _e( 'Warning: Do not upload landing page extensions here or you will break the plugin! <br>Extensions are uploaded in the WordPress plugins section.' , 'landing-pages'); ?></p>
234
<form action="" class="wp-upload-form" enctype="multipart/form-data" method="post">
235
<input type="hidden" value="<?php echo wp_create_nonce('lp-nonce'); ?>" name="lp_wpnonce" id="_wpnonce">
236
<input type="hidden" value="/wp-admin/plugin-install.php?tab=upload" name="_wp_http_referer">
237
- <label for="pluginzip" class="screen-reader-text"><?php _e( 'Template zip file' , 'landing-pages'); ?></label>
238
<input type="file" name="templatezip" id="templatezip">
239
<input type="submit" value="Install Now" class="button" id="install-template-submit" name="install-template-submit" disabled="">
240
</form>
@@ -249,18 +249,18 @@ class Landing_Pages_Template_Management {
249
?>
250
251
<div class="wrap templates_search" style='display:none'>
252
- <div class="icon32" id="icon-plugins"><br></div><h2><?php _e( 'Search Templates' , 'landing-pages'); ?></h2>
253
254
<ul class="subsubsub">
255
- <li class="plugin-install-dashboard"><a href="#search" id='menu_search'><?php _e( 'Search' , 'landing-pages'); ?></a> |</li>
256
- <li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , 'landing-pages'); ?></a> </li>
257
</ul>
258
259
<br class="clear">
260
- <p class="install-help"><?php _e( 'Search the Inboundnow marketplace for free and premium templates.' , 'landing-pages'); ?></p>
261
<form action="edit.php?post_type=landing-page&page=lp_store" method="POST" id="">
262
<input type="search" autofocus="autofocus" value="" name="search">
263
- <label for="plugin-search-input" class="screen-reader-text"><?php _e( 'Search Templates' , 'landing-pages'); ?></label>
264
<input type="submit" value="Search Templates" class="button" id="plugin-search-input" name="plugin-search-input">
265
</form>
266
</div>
228
</ul>
229
230
<br class="clear">
231
+ <h4><?php _e('Install Landing Pages template by uploading them here in .zip format' , 'inbound-pro'); ?></h4>
232
233
+ <p class="install-help"><?php _e( 'Warning: Do not upload landing page extensions here or you will break the plugin! <br>Extensions are uploaded in the WordPress plugins section.' , 'inbound-pro'); ?></p>
234
<form action="" class="wp-upload-form" enctype="multipart/form-data" method="post">
235
<input type="hidden" value="<?php echo wp_create_nonce('lp-nonce'); ?>" name="lp_wpnonce" id="_wpnonce">
236
<input type="hidden" value="/wp-admin/plugin-install.php?tab=upload" name="_wp_http_referer">
237
+ <label for="pluginzip" class="screen-reader-text"><?php _e( 'Template zip file' , 'inbound-pro'); ?></label>
238
<input type="file" name="templatezip" id="templatezip">
239
<input type="submit" value="Install Now" class="button" id="install-template-submit" name="install-template-submit" disabled="">
240
</form>
249
?>
250
251
<div class="wrap templates_search" style='display:none'>
252
+ <div class="icon32" id="icon-plugins"><br></div><h2><?php _e( 'Search Templates' , 'inbound-pro'); ?></h2>
253
254
<ul class="subsubsub">
255
+ <li class="plugin-install-dashboard"><a href="#search" id='menu_search'><?php _e( 'Search' , 'inbound-pro'); ?></a> |</li>
256
+ <li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , 'inbound-pro'); ?></a> </li>
257
</ul>
258
259
<br class="clear">
260
+ <p class="install-help"><?php _e( 'Search the Inboundnow marketplace for free and premium templates.' , 'inbound-pro'); ?></p>
261
<form action="edit.php?post_type=landing-page&page=lp_store" method="POST" id="">
262
<input type="search" autofocus="autofocus" value="" name="search">
263
+ <label for="plugin-search-input" class="screen-reader-text"><?php _e( 'Search Templates' , 'inbound-pro'); ?></label>
264
<input type="submit" value="Search Templates" class="button" id="plugin-search-input" name="plugin-search-input">
265
</form>
266
</div>
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.3.7
7
Author: Inbound Now
8
Author URI: http://www.inboundnow.com/
9
@@ -37,7 +37,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
37
*/
38
private static function load_constants() {
39
40
- define('LANDINGPAGES_CURRENT_VERSION', '2.3.7' );
41
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
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.3.8
7
Author: Inbound Now
8
Author URI: http://www.inboundnow.com/
9
37
*/
38
private static function load_constants() {
39
40
+ define('LANDINGPAGES_CURRENT_VERSION', '2.3.8' );
41
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
42
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
43
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.6.0
10
- Stable Tag: 2.3.7
11
12
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
13
@@ -30,7 +30,7 @@ Landing pages are an ideal way to convert more of your passive website visitors
30
* Use your current WordPress theme or choose from our library of custom landing page designs.
31
* Pre-populate Forms with visitor information to increase conversion rates
32
* Gather lead intelligence and track lead activity with <a href="http://wordpress.org/plugins/leads/screenshots/">WordPress Leads</a>
33
- * Extend functionality with our growing repository of <a href="http://www.inboundnow.com/market/category/landing-pages/extensions/">third party add ons</a>.
34
* Easily implement your own custom landing page design.
35
36
@@ -70,6 +70,9 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
70
71
== Changelog ==
72
73
= 2.3.7 =
74
* [tweak] Better CSS support for SVTLE template
75
* [update] Update shared folder.
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.6.1
10
+ Stable Tag: 2.3.8
11
12
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
13
30
* Use your current WordPress theme or choose from our library of custom landing page designs.
31
* Pre-populate Forms with visitor information to increase conversion rates
32
* Gather lead intelligence and track lead activity with <a href="http://wordpress.org/plugins/leads/screenshots/">WordPress Leads</a>
33
+ * Extend functionality with our growing repository of <a href="http://www.inboundnow.com/marketplace">third party add ons</a>.
34
* Easily implement your own custom landing page design.
35
36
70
71
== Changelog ==
72
73
+ = 2.3.8 =
74
+ * Improving events storage and events reporting.
75
+
76
= 2.3.7 =
77
* [tweak] Better CSS support for SVTLE template
78
* [update] Update shared folder.
shared/assets/js/frontend/analytics-src/analytics.events.js CHANGED
@@ -50,9 +50,7 @@ var _inboundEvents = (function(_inbound) {
50
function fireEvent(eventName, data, options) {
51
var data = data || {};
52
options = options || {};
53
- //alert('ran + ' + eventName);
54
- //console.log(eventName);
55
- //console.log(data);
56
/*! defaults for JS dispatch event */
57
options.bubbles = options.bubbles || true,
58
options.cancelable = options.cancelable || true;
50
function fireEvent(eventName, data, options) {
51
var data = data || {};
52
options = options || {};
53
+
54
/*! defaults for JS dispatch event */
55
options.bubbles = options.bubbles || true,
56
options.cancelable = options.cancelable || true;
shared/assets/js/frontend/analytics-src/analytics.forms.js CHANGED
@@ -98,7 +98,6 @@ var InboundForms = (function(_inbound) {
98
if (!form.dataset.formProcessed) {
99
form.dataset.formProcessed = true;
100
trackForm = this.checkTrackStatus(form);
101
- // var trackForm = _inbound.Utils.hasClass("wpl-track-me", form);
102
if (trackForm) {
103
this.attachFormSubmitEvent(form); /* attach form listener */
104
this.initFormMapping(form);
@@ -395,10 +394,7 @@ var InboundForms = (function(_inbound) {
395
if (formInput.dataset.mapFormField) {
396
inputsObject[inputName]['map'] = formInput.dataset.mapFormField;
397
}
398
- /*if (formInput.id) { inputsObject[inputName]['id'] = formInput.id; }
399
- if ('classList' in document.documentElement) {
400
- if (formInput.classList) { inputsObject[inputName]['class'] = formInput.classList; }
401
- }*/
402
403
switch (formInput.nodeName) {
404
@@ -430,7 +426,6 @@ var InboundForms = (function(_inbound) {
430
value = (formInput.value);
431
}
432
433
- //console.log('select val', value);
434
break;
435
}
436
@@ -566,23 +561,6 @@ var InboundForms = (function(_inbound) {
566
// data['search_data'] = JSON.stringify(jQuery.totalStorage('inbound_search')) || {};
567
search_data = {};
568
/* Filter here for raw */
569
- //alert(mapped_params);
570
- /**
571
- * Old data model
572
- var return_data = {
573
- "action": 'inbound_store_lead',
574
- "emailTo": data['email'],
575
- "first_name": data['first_name'],
576
- "last_name": data['last_name'],
577
- "phone": data['phone'],
578
- "address": data['address'],
579
- "company_name": data['company'],
580
- "page_views": data['page_views'],
581
- "form_input_values": all_form_fields,
582
- "Mapped_Data": mapped_form_data,
583
- "Search_Data": data['search_data']
584
- };
585
- */
586
formData = {
587
'action': 'inbound_lead_store',
588
'email': email,
@@ -600,6 +578,7 @@ var InboundForms = (function(_inbound) {
600
'source': utils.readCookie("inbound_referral_site"),
601
'inbound_submitted': inbound_form_is_ajax,
602
'inbound_form_id': inbound_form_id,
603
};
604
605
callback = function(leadID) {
98
if (!form.dataset.formProcessed) {
99
form.dataset.formProcessed = true;
100
trackForm = this.checkTrackStatus(form);
101
if (trackForm) {
102
this.attachFormSubmitEvent(form); /* attach form listener */
103
this.initFormMapping(form);
394
if (formInput.dataset.mapFormField) {
395
inputsObject[inputName]['map'] = formInput.dataset.mapFormField;
396
}
397
+
398
399
switch (formInput.nodeName) {
400
426
value = (formInput.value);
427
}
428
429
break;
430
}
431
561
// data['search_data'] = JSON.stringify(jQuery.totalStorage('inbound_search')) || {};
562
search_data = {};
563
/* Filter here for raw */
564
formData = {
565
'action': 'inbound_lead_store',
566
'email': email,
578
'source': utils.readCookie("inbound_referral_site"),
579
'inbound_submitted': inbound_form_is_ajax,
580
'inbound_form_id': inbound_form_id,
581
+ 'event': form
582
};
583
584
callback = function(leadID) {
shared/assets/js/frontend/analytics/inboundAnalytics.js CHANGED
@@ -1402,7 +1402,6 @@ var InboundForms = (function(_inbound) {
1402
if (!form.dataset.formProcessed) {
1403
form.dataset.formProcessed = true;
1404
trackForm = this.checkTrackStatus(form);
1405
- // var trackForm = _inbound.Utils.hasClass("wpl-track-me", form);
1406
if (trackForm) {
1407
this.attachFormSubmitEvent(form); /* attach form listener */
1408
this.initFormMapping(form);
@@ -1699,10 +1698,7 @@ var InboundForms = (function(_inbound) {
1699
if (formInput.dataset.mapFormField) {
1700
inputsObject[inputName]['map'] = formInput.dataset.mapFormField;
1701
}
1702
- /*if (formInput.id) { inputsObject[inputName]['id'] = formInput.id; }
1703
- if ('classList' in document.documentElement) {
1704
- if (formInput.classList) { inputsObject[inputName]['class'] = formInput.classList; }
1705
- }*/
1706
1707
switch (formInput.nodeName) {
1708
@@ -1734,7 +1730,6 @@ var InboundForms = (function(_inbound) {
1734
value = (formInput.value);
1735
}
1736
1737
- //console.log('select val', value);
1738
break;
1739
}
1740
@@ -1870,23 +1865,6 @@ var InboundForms = (function(_inbound) {
1870
// data['search_data'] = JSON.stringify(jQuery.totalStorage('inbound_search')) || {};
1871
search_data = {};
1872
/* Filter here for raw */
1873
- //alert(mapped_params);
1874
- /**
1875
- * Old data model
1876
- var return_data = {
1877
- "action": 'inbound_store_lead',
1878
- "emailTo": data['email'],
1879
- "first_name": data['first_name'],
1880
- "last_name": data['last_name'],
1881
- "phone": data['phone'],
1882
- "address": data['address'],
1883
- "company_name": data['company'],
1884
- "page_views": data['page_views'],
1885
- "form_input_values": all_form_fields,
1886
- "Mapped_Data": mapped_form_data,
1887
- "Search_Data": data['search_data']
1888
- };
1889
- */
1890
formData = {
1891
'action': 'inbound_lead_store',
1892
'email': email,
@@ -1904,6 +1882,7 @@ var InboundForms = (function(_inbound) {
1904
'source': utils.readCookie("inbound_referral_site"),
1905
'inbound_submitted': inbound_form_is_ajax,
1906
'inbound_form_id': inbound_form_id,
1907
};
1908
1909
callback = function(leadID) {
@@ -2381,9 +2360,7 @@ var _inboundEvents = (function(_inbound) {
2381
function fireEvent(eventName, data, options) {
2382
var data = data || {};
2383
options = options || {};
2384
- //alert('ran + ' + eventName);
2385
- //console.log(eventName);
2386
- //console.log(data);
2387
/*! defaults for JS dispatch event */
2388
options.bubbles = options.bubbles || true,
2389
options.cancelable = options.cancelable || true;
1402
if (!form.dataset.formProcessed) {
1403
form.dataset.formProcessed = true;
1404
trackForm = this.checkTrackStatus(form);
1405
if (trackForm) {
1406
this.attachFormSubmitEvent(form); /* attach form listener */
1407
this.initFormMapping(form);
1698
if (formInput.dataset.mapFormField) {
1699
inputsObject[inputName]['map'] = formInput.dataset.mapFormField;
1700
}
1701
+
1702
1703
switch (formInput.nodeName) {
1704
1730
value = (formInput.value);
1731
}
1732
1733
break;
1734
}
1735
1865
// data['search_data'] = JSON.stringify(jQuery.totalStorage('inbound_search')) || {};
1866
search_data = {};
1867
/* Filter here for raw */
1868
formData = {
1869
'action': 'inbound_lead_store',
1870
'email': email,
1882
'source': utils.readCookie("inbound_referral_site"),
1883
'inbound_submitted': inbound_form_is_ajax,
1884
'inbound_form_id': inbound_form_id,
1885
+ 'event': form
1886
};
1887
1888
callback = function(leadID) {
2360
function fireEvent(eventName, data, options) {
2361
var data = data || {};
2362
options = options || {};
2363
+
2364
/*! defaults for JS dispatch event */
2365
options.bubbles = options.bubbles || true,
2366
options.cancelable = options.cancelable || true;
shared/assets/js/frontend/analytics/inboundAnalytics.min.js CHANGED
@@ -1,3 +1,3 @@
1
/*! Inbound Analyticsv1.0.0 | (c) 2016 Inbound Now | https://github.com/inboundnow/cta */
2
- function inboundFormNoRedirect(){if(null==window.frames.frameElement)var 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("undefined"!=typeof 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)var 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("undefined"!=typeof e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),i=jQuery(e).css("background"),o=jQuery(e).css("color"),a=jQuery(e).css("height"),r=e.getElementsByClassName("inbound-form-spinner");(0==n.length||"IA=="==n[0].value)&&(jQuery(r).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+i+"; color="+o+"; font-size:calc("+a+' * .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,i={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i},debug:function(){},deBugger:function(e,t,n){if(console){var i,o,a,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(r=r.split("-"),a=r[1]),o="true"===_inbound.Utils.readCookie("inbound_debug")?!0:!1,i="true"===_inbound.Utils.readCookie("inbound_debug_"+e)?!0:!1,(i||s||o)&&(t&&"string"==typeof t&&(o||"all"===a?console.log('logAll "'+e+'" =>',t):i?console.log('log "'+e+'" =>',t):e===a&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},i=n.extend(t,e);return n.Settings=i||{},n}(_inboundOptions),_inboundHooks=function(e){var t=function(){function e(e,t,n,i){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("actions",e,t,n,i)),d}function t(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&u("actions",t,e),d}function n(e,t){return"string"==typeof e&&r("actions",e,t),d}function i(e,t,n){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("filters",e,t,n)),d}function o(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?u("filters",t,e):d}function a(e,t){return"string"==typeof e&&r("filters",e,t),d}function r(e,t,n,i){if(c[e][t])if(n){var o,a=c[e][t];if(i)for(o=a.length;o--;){var r=a[o];r.callback===n&&r.context===i&&a.splice(o,1)}else for(o=a.length;o--;)a[o].callback===n&&a.splice(o,1)}else c[e][t]=[]}function s(e,t,n,i,o){var a={callback:n,priority:i,context:o},r=c[e][t];r?(r.push(a),r=l(r)):r=[a],c[e][t]=r}function l(e){for(var t,n,i,o=1,a=e.length;a>o;o++){for(t=e[o],n=o;(i=e[n-1])&&i.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function u(e,t,n){var i=c[e][t];if(!i)return"filters"===e?n[0]:!1;var o=0,a=i.length;if("filters"===e)for(;a>o;o++)n[0]=i[o].callback.apply(i[o].context,n);else for(;a>o;o++)i[o].callback.apply(i[o].context,n);return"filters"===e?n[0]:!0}var d={removeFilter:a,applyFilters:o,addFilter:i,removeAction:n,doAction:t,addAction:e},c={actions:{},filters:{}};return d};return e.hooks=new t,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,i=(Object.prototype.toString,("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/#x2F;,"")),o={api_host:i,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}#x2F;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(n){this.CustomEvent=function(e,t){function n(n,o){var a=document.createEvent(e);return null!==n?i.call(a,n,(o||(o=t)).bubbles,o.cancelable,o.detail):a.initCustomEvent=i,a}function i(t,n,i,o){this["init"+e](t,n,i,o),"detail"in this||(this.detail=o)}return n}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),i=[];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(),t.style.removeAttribute("x-qsa"),i.push(t);return document._qsa=null,i}),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=[],i=0;i<t.rangeCount;i++)n[i]=t.getRangeAt(i);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(var i=0;i<n.length;i++)t.addRange(n[i]);return e})},createCookie:function(e,t,n){var i="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),i="; expires="+o.toGMTString()}document.cookie=e+"="+t+i+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.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(";"),i=0;i<n.length;i++){var o=n[i].split("=");o[0]=o[0].replace(/^ /,""),t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},i=window.location.search.substring(1),o=/([^&=]+)=?([^&]*)/g;e=o.exec(i);)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 i in n)if("action"!=i)if("object"==typeof n[i])for(var o in n[i])this.createCookie(o,n[i][o],30);else this.createCookie(i,n[i],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(){var 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="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof ls||"undefined"==typeof window.JSON?!1:!0}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}function n(t){return{name:t,size:e(localStorage[t])}}function i(e){return e.size=t(e.size).toFixed(2)+" MB",e}var o=Object.keys(localStorage).map(n).map(i);console.table(o)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=10>t?"0":"",i=e.getFullYear(),o=e.getHours(),a=10>o?"0":"",r=e.getMinutes(),s=10>r?"0":"",l=e.getSeconds(),u=10>l?"0":"",d=e.getMonth()+1,c=10>d?"0":"",m=i+"/"+c+d+"/"+n+t+" "+a+o+":"+s+r+":"+u+l;return m},SetSessionTimeout:function(){var e=(this.readCookie("lead_session_expire"),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",i=e.Utils.readCookie("inbound_referral_site"),o=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),i||this.createCookie("inbound_referral_site",n,t),o||e.totalStorage("inbound_original_referral",o)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var i=0;e>i;i++)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 i in e)n[i]=e[i];for(var i in t)n[i]=t[i];return n},hasClass:function(e,t){var n;if("classList"in document.documentElement)var 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(i){}return e},ajaxSendData:function(e,t,n,i){var o=this.ajaxPolyFill();setTimeout(function(){o.open(n,e,!0),o.onreadystatechange=function(){4==o.readyState&&t(o.responseText)},"POST"==n&&o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(i)},100)},ajaxGet:function(e,t,n,i){var o=[];for(var a in t)o.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e+"?"+o.join("&"),n,"GET",null,i)},ajaxPost:function(e,t,n,i){var o=[];for(var a in t)o.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e,n,"POST",o.join("&"),i)},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,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener?"addEventListener":"attachEvent",s=o.addEventListener?"removeEventListener":"detachEvent",l=o.addEventListener?"":"on",u=function(i){("readystatechange"!=i.type||"complete"==o.readyState)&&(("load"==i.type?e:o)[s](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},d=function(){try{a.doScroll("left")}catch(e){return setTimeout(d,50),void 0}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(o.createEventObject&&a.doScroll){try{i=!e.frameElement}catch(c){}i&&d()}o[r](l+"DOMContentLoaded",u,!1),o[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,i,o,a=null,r=0,s=function(){r=new Date,a=null,o=e.apply(n,i)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,i=arguments,0>=u?(clearTimeout(a),a=null,r=l,o=e.apply(n,i)):a||(a=setTimeout(s,u)),o}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),"undefined"!=typeof _gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)}},e}(_inbound||{}),InboundForms=function(e){var t=!1,n=e.Utils,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.assignTrackClass(),e.Forms.formTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,n){if(t&&console){var e=e||!1;e&&"string"==typeof e&&console.log(e),n&&n instanceof Function&&n()}},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=!1,n=window.document.forms[e];n.dataset.formProcessed||(n.dataset.formProcessed=!0,t=this.checkTrackStatus(n),t&&(this.attachFormSubmitEvent(n),this.initFormMapping(n)))}},checkTrackStatus:function(t){var n=t.getAttribute("class");return""!==n&&null!==n?n.toLowerCase().indexOf("wpl-track-me")>-1?!0:n.toLowerCase().indexOf("inbound-track")>-1?!0:(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1):void 0},assignTrackClass:function(){if(window.inbound_settings){if(inbound_settings.inbound_track_include){var t=inbound_settings.inbound_track_include.split(","),n="add selectors "+inbound_settings.inbound_track_include;e.deBugger("forms",n),this.loopClassSelectors(t,"add")}if(inbound_settings.inbound_track_exclude){var t=inbound_settings.inbound_track_exclude.split(","),n="remove selectors "+inbound_settings.inbound_track_exclude;e.deBugger("forms",n),this.loopClassSelectors(t,"remove")}}},loopClassSelectors:function(t,i){for(var o=t.length-1;o>=0;o--){var a=n.trim(t[o]);-1===a.indexOf("#")&&-1===a.indexOf(".")&&(a="#"+a),a=document.querySelector(a),a&&("add"===i?(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=[],i=0;i<t.elements.length;i++)formInput=t.elements[i],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var o=n.length-1;o>=0;o--)formInput=n[o],this.mapField(formInput)},mapField:function(t){var a=t.id||!1,r=t.name||!1,s=this.getInputLabel(t);if(s){var u=this.ignoreFieldByLabel(s[0].innerText);if(u)return t.dataset.ignoreFormField=!0,!1}for(i=0;i<l.length;i++){var d=!1,c=l[i],m=n.trim(c),f=m.replace(/ /g,"_");r&&r.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching name attribute for -> "+m)):a&&a.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching ID attribute for ->"+m)):s?s[0].innerText.toLowerCase().indexOf(m)>-1&&(d=!0,e.deBugger("forms","Found matching sibling label for -> "+m)):o.push(m),d&&(this.addDataAttr(t,f),this.removeArrayItem(l,m),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},attachFormSubmitEvent:function(e){n.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},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):!1},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;("visa"==e.toLowerCase()||"mastercard"==e.toLowerCase()||"american express"==e.toLowerCase()||"amex"==e.toLowerCase()||"discover"==e.toLowerCase())&&(t=!0);var n=new RegExp("/^[0-9]+#x2F;");if(n.test(e)){var i=e.replace(" ","");this.isInt(i)&&i.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",n.removeClass("wpl-track-me",e),n.removeListener(e,"submit",this.formListener);var t=e.getAttribute("class");return""!==t&&null!==t&&-1!=t.toLowerCase().indexOf("wpcf7-form")?(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),void 0)},saveFormData:function(t){for(var i=i||{},o=0;o<t.elements.length;o++)if(formInput=t.elements[o],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(l=this.getInputValue(formInput),l===!1)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("undefined"!=typeof d&&null!=d&&""!=d&&a.push(u+"="+i[u].value.join(",")),"undefined"!=typeof c&&null!=c&&i[u].value&&(r.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=a.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=r.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g);var m=n.getParameterVal("email",g)||n.readCookie("wp_lead_email");m||(m=n.getParameterVal("wpleads_email_address",g));var p=n.getParameterVal("name",g),v=n.getParameterVal("first_name",g),h=n.getParameterVal("last_name",g);if(!h&&v){var _=decodeURI(v).split(" ");_.length>0&&(v=_[0],h=_[1])}if(p&&!h&&!v){var _=decodeURI(p).split(" ");_.length>0&&(v=_[0],h=_[1])}p=v&&h?v+" "+h:p,v||(v=""),h||(h=""),e.deBugger("forms","fName = "+v),e.deBugger("forms","lName = "+h),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)var k=!0;var C=t.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');C=C.length>0?C[0].value:0;if("undefined"!=typeof landing_path_info)var S=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)var S=cta_path_info.variation;else var S=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:v,last_name:h,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:S,source:n.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:C},callback=function(i){e.deBugger("forms","Lead Created with ID: "+i),i=parseInt(i,10),formData.leadID=i,i&&(n.createCookie("wp_lead_id",i),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(t)},e.trigger("form_before_submission",formData),n.ajaxPost(inbound_settings.admin_url,formData,callback)},rememberInputValues:function(t){var i=(t.name?"inbound_"+t.name:"",t.type?t.type:"text");return"submit"===i||"hidden"===i||"file"===i||"password"===i||t.dataset.ignoreFormField?!1:(n.addListener(t,"change",function(t){if(t.target.name){if("checkbox"!==i)var o=t.target.value;else for(var a=[],r=document.querySelectorAll('input[name="'+t.target.name+'"]'),s=0;s<r.length;s++){var l=r[s].checked;l&&a.push(r[s].value),o=a.join(",")}inputData={name:t.target.name,node:t.target.nodeName.toLowerCase(),type:i,value:o,mapping:t.target.dataset.mapFormField},e.trigger("form_input_change",inputData),n.createCookie("inbound_"+t.target.name,encodeURIComponent(o))}}),void 0)},fillInputValues:function(e){var t=e.name?"inbound_"+e.name:"",i=e.type?e.type:"text";if("submit"===i||"hidden"===i||"file"===i||"password"===i)return!1;if(n.readCookie(t)&&"comment"!=t)if(value=decodeURIComponent(n.readCookie(t)),"checkbox"===i||"radio"===i)for(var o=value.split(","),a=0;a<o.length;a++)e.value.indexOf(o[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:!1},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),i=n.length-1;i>=0;i--)e.dataset.mapFormField||(n[i].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=[],i=t.length-1;i>=0;i--)"label"===t[i].nodeName.toLowerCase()&&n.push(t[i]);return n.length>0&&n.length<2?n:!1},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&&(n.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(t){var i=document.querySelector(".email_suggestion");i&&n.removeElement(i);var o=document.createElement("span");o.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+t.full+"</b></i>?</span>",e.parentNode.insertBefore(o,e.nextSibling);var a=document.getElementById("email_correction");n.addListener(a,"click",function(){e.value=a.innerHTML,a.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},"undefined"==typeof 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,i=e.empty||t,o=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return o?n(o):i()},suggest:function(e,t,n,i){e=e.toLowerCase();var o=this.splitEmail(e),a=this.findClosestDomain(o.domain,t,i,this.domainThreshold);if(a){if(a!=o.domain)return{address:o.address,domain:a,full:o.address+"@"+a}}else{var r=this.findClosestDomain(o.topLevelDomain,n,i,this.topLevelThreshold);if(o.domain&&r&&r!=o.topLevelDomain){var s=o.domain;return a=s.substring(0,s.lastIndexOf(o.topLevelDomain))+r,{address:o.address,domain:a,full:o.address+"@"+a}}}return!1},findClosestDomain:function(e,t,n,i){i=i||this.topLevelThreshold;var o,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;o=n(e,t[s]),a>o&&(a=o,r=t[s])}return i>=a&&null!==r?r:!1},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,i=0,o=0,a=0,r=5;n+i<e.length&&n+o<t.length;){if(e.charAt(n+i)==t.charAt(n+o))a++;else{i=0,o=0;for(var s=0;r>s;s++){if(n+s<e.length&&e.charAt(n+s)==t.charAt(n)){i=s;break}if(n+s<t.length&&e.charAt(n)==t.charAt(n+s)){o=s;break}}}n++}return(e.length+t.length)/2-a},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(var n=0;n<t.length;n++)if(""===t[n])return!1;var i=t.pop(),o=i.split("."),a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{for(var n=1;n<o.length;n++)a+=o[n]+".";o.length>=2&&(a=a.substring(0,a.length-1))}return{topLevelDomain:a,domain:i,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,i,o){var i=i||{};o=o||{},o.bubbles=o.bubbles||!0,o.cancelable=o.cancelable||!0,i=e.apply_filters("filter_"+t,i);!window.ActiveXObject&&"ActiveXObject"in window;if("function"==typeof CustomEvent)var a=new CustomEvent(t,{detail:i,bubbles:o.bubbles,cancelable:o.cancelable});else{var a=document.createEvent("Event");a.initEvent(t,!0,!0)}window.dispatchEvent(a),e.do_action(t,i),n(t,i)}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(){var e={opt1:!0},n={data:"xyxy"};t("analytics_ready",n,e)},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){var n={clock:e,leadData:InboundLeadData};t("session_heartbeat",n)},page_visit:function(e){t("page_view",e)},page_first_visit:function(){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);var i=function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")};e.deBugger("pages",status,i)},tab_hidden:function(){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){var i=function(){console.log(n)};e.deBugger("forms","inputData change. Data=",i),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)},analyticsError:function(e,t,n){var i=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(i),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,i="_inbound";if("localStorage"in window)try{n="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof n||"undefined"==typeof window.JSON?!1:!0,window.localStorage.setItem(i,"1"),window.localStorage.removeItem(i)}catch(o){t=!1}e.totalStorage=function(t,n){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"undefined"!=typeof t?this.setItem(e,t):this.getItem(e)},setItem:function(i,o){if(!t)try{return e.Utils.createCookie(i,o),o}catch(a){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 r=JSON.stringify(o);return n.setItem(i,r),this.parseResult(r)},getItem:function(i){if(!t)try{return this.parseResult(e.Utils.readCookie(i))}catch(o){return null}var a=n.getItem(i);return this.parseResult(a)},deleteItem:function(i){if(!t)try{return e.Utils.eraseCookie(i,null),!0}catch(o){return!1}return n.removeItem(i),!0},getAll:function(){var i=[];if(t)for(var o in n)o.length&&i.push({key:o,value:this.parseResult(n.getItem(o))});else try{for(var a=document.cookie.split(";"),r=0;r<a.length;r++){var s=a[r].split("="),l=s[0];i.push({key:l,value:this.parseResult(e.Utils.readCookie(l))})}}catch(u){return null}return i},parseResult:function(e){var t;try{t=JSON.parse(e),"undefined"==typeof t&&(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")),i=t.readCookie("lead_session_expire");i||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(){var t=e.Utils.readCookie("wp_lead_id"),n=e.totalStorage("inbound_lead_data"),i=e.Utils.readCookie("lead_data_expire");
3
data={action:"inbound_get_all_lead_data",wp_lead_id:t},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var i=new Date;i.setTime(i.getTime()+18e5);var o=e.Utils.addDays(i,3);e.Utils.createCookie("lead_data_expire",!0,o)},n?(e.LeadsAPI.setGlobalLeadData(n),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=e.Utils.readCookie("wp_lead_id"),n={action:"wpl_check_lists",wp_lead_id:t},i=function(){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")};e.Utils.ajaxPost(inbound_settings.admin_url,n,i)}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,i=!1,o=!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,v=e.Settings.timeout||1e4;return e.PageTracking={init:function(i){return"page_views"!==f?!1:(this.CheckTimeOut(),i=i||{},t=parseInt(i.reportInterval,10)||10,n=parseInt(i.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(),void 0)},setIdle:function(t){var t=t||"No Movement",n="Session IDLE. Activity Timeout due to "+t;e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n,i;"undefined"!=typeof document.hidden?(t="hidden",i="visibilitychange",n="visibilityState"):"undefined"!=typeof document.mozHidden?(t="mozHidden",i="mozvisibilitychange",n="mozVisibilityState"):"undefined"!=typeof document.msHidden?(t="msHidden",i="msvisibilitychange",n="msVisibilityState"):"undefined"!=typeof document.webkitHidden&&(t="webkitHidden",i="webkitvisibilitychange",n="webkitVisibilityState");var o=document[t];e.Utils.addListener(document,i,function(){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(){r+=1;var n=r/60,i="Total time spent on Page in this Session: "+n.toFixed(2)+" min";if(e.deBugger("pages",i),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(){s+=1;var t=(1800-s)/60,n="Time until Session Timeout: "+t.toFixed(2)+" min";e.deBugger("pages",n),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){o=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){o=!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;i=!0,l=setInterval(e.PageTracking.clock,1e3);var t=c.readCookie("lead_session");if(t)e.trigger("session_active");else{e.trigger("session_start");var n=new Date;n.setTime(n.getTime()+18e5),e.Utils.createCookie("lead_session",1,n)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){a||(i||e.PageTracking.startSession(),o&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),"undefined"!=typeof t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){var t=e.Utils.checkLocalStorage();if(t){var n=localStorage.getItem(f),i=JSON.parse(n);return i}},isRevisit:function(e){var t=!1,e=e||{},n=e[p];return"undefined"!=typeof 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,i=this.isRevisit(g);if(i){var o=g[p].length-1,a=g[p][o],r=Math.abs(new Date(a).getTime()-new Date(m).getTime());n=r>v,n?(t="Timeout Happened. Page view fired",this.triggerPageView(i)):(time_left=.001*Math.abs(v-r),t=v/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(i);e.deBugger("pages",t)},storePageView:function(){if("off"!=inbound_settings.page_tracking){var t=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",n=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",i={action:"inbound_track_lead",wp_lead_uid:n,wp_lead_id:t,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()),json:"0"},o=function(){};e.Utils.ajaxPost(inbound_settings.admin_url,i,o)}}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
1
/*! Inbound Analyticsv1.0.0 | (c) 2016 Inbound Now | https://github.com/inboundnow/cta */
2
+ function inboundFormNoRedirect(){if(null==window.frames.frameElement)var 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("undefined"!=typeof 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)var 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("undefined"!=typeof e){var t=e.form,n=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),i=jQuery(e).css("background"),o=jQuery(e).css("color"),a=jQuery(e).css("height"),r=e.getElementsByClassName("inbound-form-spinner");(0==n.length||"IA=="==n[0].value)&&(jQuery(r).remove(),jQuery(e).prepend('<div id="redir-check"><i class="fa fa-check-square" aria-hidden="true" style="background='+i+"; color="+o+"; font-size:calc("+a+' * .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,i={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n]);for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i},debug:function(){},deBugger:function(e,t,n){if(console){var i,o,a,r=document.location.hash?document.location.hash:"",s=r.indexOf("#debug")>-1,t=t||!1;r&&r.match(/debug/)&&(r=r.split("-"),a=r[1]),o="true"===_inbound.Utils.readCookie("inbound_debug")?!0:!1,i="true"===_inbound.Utils.readCookie("inbound_debug_"+e)?!0:!1,(i||s||o)&&(t&&"string"==typeof t&&(o||"all"===a?console.log('logAll "'+e+'" =>',t):i?console.log('log "'+e+'" =>',t):e===a&&console.log('#log "'+e+'" =>',t)),n&&n instanceof Function&&n())}}},i=n.extend(t,e);return n.Settings=i||{},n}(_inboundOptions),_inboundHooks=function(e){var t=function(){function e(e,t,n,i){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("actions",e,t,n,i)),d}function t(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t&&u("actions",t,e),d}function n(e,t){return"string"==typeof e&&r("actions",e,t),d}function i(e,t,n){return"string"==typeof e&&"function"==typeof t&&(n=parseInt(n||10,10),s("filters",e,t,n)),d}function o(){var e=Array.prototype.slice.call(arguments),t=e.shift();return"string"==typeof t?u("filters",t,e):d}function a(e,t){return"string"==typeof e&&r("filters",e,t),d}function r(e,t,n,i){if(c[e][t])if(n){var o,a=c[e][t];if(i)for(o=a.length;o--;){var r=a[o];r.callback===n&&r.context===i&&a.splice(o,1)}else for(o=a.length;o--;)a[o].callback===n&&a.splice(o,1)}else c[e][t]=[]}function s(e,t,n,i,o){var a={callback:n,priority:i,context:o},r=c[e][t];r?(r.push(a),r=l(r)):r=[a],c[e][t]=r}function l(e){for(var t,n,i,o=1,a=e.length;a>o;o++){for(t=e[o],n=o;(i=e[n-1])&&i.priority>t.priority;)e[n]=e[n-1],--n;e[n]=t}return e}function u(e,t,n){var i=c[e][t];if(!i)return"filters"===e?n[0]:!1;var o=0,a=i.length;if("filters"===e)for(;a>o;o++)n[0]=i[o].callback.apply(i[o].context,n);else for(;a>o;o++)i[o].callback.apply(i[o].context,n);return"filters"===e?n[0]:!0}var d={removeFilter:a,applyFilters:o,addFilter:i,removeAction:n,doAction:t,addAction:e},c={actions:{},filters:{}};return d};return e.hooks=new t,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,i=(Object.prototype.toString,("https:"==location.protocol?"https://":"http://")+location.hostname+location.pathname.replace(/\/#x2F;,"")),o={api_host:i,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}#x2F;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(n){this.CustomEvent=function(e,t){function n(n,o){var a=document.createEvent(e);return null!==n?i.call(a,n,(o||(o=t)).bubbles,o.cancelable,o.detail):a.initCustomEvent=i,a}function i(t,n,i,o){this["init"+e](t,n,i,o),"detail"in this||(this.detail=o)}return n}(this.CustomEvent?"CustomEvent":"Event",{bubbles:!1,cancelable:!1,detail:null})}document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),i=[];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(),t.style.removeAttribute("x-qsa"),i.push(t);return document._qsa=null,i}),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=[],i=0;i<t.rangeCount;i++)n[i]=t.getRangeAt(i);t.removeAllRanges(),t.selectAllChildren(this),e=t.toString(),t.removeAllRanges();for(var i=0;i<n.length;i++)t.addRange(n[i]);return e})},createCookie:function(e,t,n){var i="";if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),i="; expires="+o.toGMTString()}document.cookie=e+"="+t+i+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return o.substring(t.length,o.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(";"),i=0;i<n.length;i++){var o=n[i].split("=");o[0]=o[0].replace(/^ /,""),t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e.totalStorage("inbound_cookies",t),t},setUrlParams:function(){var n={};!function(){for(var e,t=function(e){return decodeURIComponent(e).replace(/\+/g," ")},i=window.location.search.substring(1),o=/([^&=]+)=?([^&]*)/g;e=o.exec(i);)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 i in n)if("action"!=i)if("object"==typeof n[i])for(var o in n[i])this.createCookie(o,n[i][o],30);else this.createCookie(i,n[i],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(){var 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="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof ls||"undefined"==typeof window.JSON?!1:!0}catch(e){t=!1}return t},showLocalStorageSize:function(){function e(e){return 2*e.length}function t(e){return e/1024/1024}function n(t){return{name:t,size:e(localStorage[t])}}function i(e){return e.size=t(e.size).toFixed(2)+" MB",e}var o=Object.keys(localStorage).map(n).map(i);console.table(o)},addDays:function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},GetDate:function(){var e=new Date,t=e.getDate(),n=10>t?"0":"",i=e.getFullYear(),o=e.getHours(),a=10>o?"0":"",r=e.getMinutes(),s=10>r?"0":"",l=e.getSeconds(),u=10>l?"0":"",d=e.getMonth()+1,c=10>d?"0":"",m=i+"/"+c+d+"/"+n+t+" "+a+o+":"+s+r+":"+u+l;return m},SetSessionTimeout:function(){var e=(this.readCookie("lead_session_expire"),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",i=e.Utils.readCookie("inbound_referral_site"),o=e.totalStorage("inbound_original_referral");t.setTime(t.getTime()+18e5),i||this.createCookie("inbound_referral_site",n,t),o||e.totalStorage("inbound_original_referral",o)},CreateUID:function(e){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".split(""),n="";e||(e=Math.floor(Math.random()*t.length));for(var i=0;e>i;i++)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 i in e)n[i]=e[i];for(var i in t)n[i]=t[i];return n},hasClass:function(e,t){var n;if("classList"in document.documentElement)var 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(i){}return e},ajaxSendData:function(e,t,n,i){var o=this.ajaxPolyFill();setTimeout(function(){o.open(n,e,!0),o.onreadystatechange=function(){4==o.readyState&&t(o.responseText)},"POST"==n&&o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(i)},100)},ajaxGet:function(e,t,n,i){var o=[];for(var a in t)o.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e+"?"+o.join("&"),n,"GET",null,i)},ajaxPost:function(e,t,n,i){var o=[];for(var a in t)o.push(encodeURIComponent(a)+"="+encodeURIComponent(t[a]));this.ajaxSendData(e,n,"POST",o.join("&"),i)},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,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener?"addEventListener":"attachEvent",s=o.addEventListener?"removeEventListener":"detachEvent",l=o.addEventListener?"":"on",u=function(i){("readystatechange"!=i.type||"complete"==o.readyState)&&(("load"==i.type?e:o)[s](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},d=function(){try{a.doScroll("left")}catch(e){return setTimeout(d,50),void 0}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(o.createEventObject&&a.doScroll){try{i=!e.frameElement}catch(c){}i&&d()}o[r](l+"DOMContentLoaded",u,!1),o[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,i,o,a=null,r=0,s=function(){r=new Date,a=null,o=e.apply(n,i)};return function(){var l=new Date;r||(r=l);var u=t-(l-r);return n=this,i=arguments,0>=u?(clearTimeout(a),a=null,r=l,o=e.apply(n,i)):a||(a=setTimeout(s,u)),o}},checkTypeofGA:function(){"function"==typeof ga&&(universalGA=!0),"undefined"!=typeof _gaq&&"function"==typeof _gaq.push&&(classicGA=!0),"undefined"!=typeof dataLayer&&"function"==typeof dataLayer.push&&(googleTagManager=!0)}},e}(_inbound||{}),InboundForms=function(e){var t=!1,n=e.Utils,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.assignTrackClass(),e.Forms.formTrackInit()},runFieldMappingFilters:function(){l=e.hooks.applyFilters("forms.field_map",l)},debug:function(e,n){if(t&&console){var e=e||!1;e&&"string"==typeof e&&console.log(e),n&&n instanceof Function&&n()}},formTrackInit:function(){for(var e=0;e<window.document.forms.length;e++){var t=!1,n=window.document.forms[e];n.dataset.formProcessed||(n.dataset.formProcessed=!0,t=this.checkTrackStatus(n),t&&(this.attachFormSubmitEvent(n),this.initFormMapping(n)))}},checkTrackStatus:function(t){var n=t.getAttribute("class");return""!==n&&null!==n?n.toLowerCase().indexOf("wpl-track-me")>-1?!0:n.toLowerCase().indexOf("inbound-track")>-1?!0:(cb=function(){console.log(t)},e.deBugger("forms","This form not tracked. Please assign on in settings...",cb),!1):void 0},assignTrackClass:function(){if(window.inbound_settings){if(inbound_settings.inbound_track_include){var t=inbound_settings.inbound_track_include.split(","),n="add selectors "+inbound_settings.inbound_track_include;e.deBugger("forms",n),this.loopClassSelectors(t,"add")}if(inbound_settings.inbound_track_exclude){var t=inbound_settings.inbound_track_exclude.split(","),n="remove selectors "+inbound_settings.inbound_track_exclude;e.deBugger("forms",n),this.loopClassSelectors(t,"remove")}}},loopClassSelectors:function(t,i){for(var o=t.length-1;o>=0;o--){var a=n.trim(t[o]);-1===a.indexOf("#")&&-1===a.indexOf(".")&&(a="#"+a),a=document.querySelector(a),a&&("add"===i?(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=[],i=0;i<t.elements.length;i++)formInput=t.elements[i],"hidden"!==formInput.type?(this.mapField(formInput),this.rememberInputValues(formInput),s.formAutoPopulation&&!e.Utils.hasClass("nopopulate",t)&&this.fillInputValues(formInput)):n.push(formInput);for(var o=n.length-1;o>=0;o--)formInput=n[o],this.mapField(formInput)},mapField:function(t){var a=t.id||!1,r=t.name||!1,s=this.getInputLabel(t);if(s){var u=this.ignoreFieldByLabel(s[0].innerText);if(u)return t.dataset.ignoreFormField=!0,!1}for(i=0;i<l.length;i++){var d=!1,c=l[i],m=n.trim(c),f=m.replace(/ /g,"_");r&&r.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching name attribute for -> "+m)):a&&a.toLowerCase().indexOf(m)>-1?(d=!0,e.deBugger("forms","Found matching ID attribute for ->"+m)):s?s[0].innerText.toLowerCase().indexOf(m)>-1&&(d=!0,e.deBugger("forms","Found matching sibling label for -> "+m)):o.push(m),d&&(this.addDataAttr(t,f),this.removeArrayItem(l,m),i--)}return inbound_data},formListener:function(t){t.preventDefault(),e.Forms.saveFormData(t.target),document.body.style.cursor="wait"},attachFormSubmitEvent:function(e){n.addListener(e,"submit",this.formListener);document.querySelector(".inbound-email")},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):!1},ignoreFieldByValue:function(e){var t=!1;if(!e)return!1;("visa"==e.toLowerCase()||"mastercard"==e.toLowerCase()||"american express"==e.toLowerCase()||"amex"==e.toLowerCase()||"discover"==e.toLowerCase())&&(t=!0);var n=new RegExp("/^[0-9]+#x2F;");if(n.test(e)){var i=e.replace(" ","");this.isInt(i)&&i.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",n.removeClass("wpl-track-me",e),n.removeListener(e,"submit",this.formListener);var t=e.getAttribute("class");return""!==t&&null!==t&&-1!=t.toLowerCase().indexOf("wpcf7-form")?(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),void 0)},saveFormData:function(t){for(var i=i||{},o=0;o<t.elements.length;o++)if(formInput=t.elements[o],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(l=this.getInputValue(formInput),l===!1)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("undefined"!=typeof d&&null!=d&&""!=d&&a.push(u+"="+i[u].value.join(",")),"undefined"!=typeof c&&null!=c&&i[u].value&&(r.push(c+"="+i[u].value.join(",")),"email"===u))var m=i[u].value.join(",")}var f=a.join("&");e.deBugger("forms","Stringified Raw Form PARAMS: "+f);var g=r.join("&");e.deBugger("forms","Stringified Mapped PARAMS"+g);var m=n.getParameterVal("email",g)||n.readCookie("wp_lead_email");m||(m=n.getParameterVal("wpleads_email_address",g));var p=n.getParameterVal("name",g),v=n.getParameterVal("first_name",g),h=n.getParameterVal("last_name",g);if(!h&&v){var _=decodeURI(v).split(" ");_.length>0&&(v=_[0],h=_[1])}if(p&&!h&&!v){var _=decodeURI(p).split(" ");_.length>0&&(v=_[0],h=_[1])}p=v&&h?v+" "+h:p,v||(v=""),h||(h=""),e.deBugger("forms","fName = "+v),e.deBugger("forms","lName = "+h),e.deBugger("forms","fullName = "+p);var b=e.totalStorage("page_views")||{},y=e.totalStorage("inbound_url_params")||{},w=t.querySelectorAll('input[value][type="hidden"][name="inbound_furl"]:not([value=""])'),k=!1;if(0==w.length||"IA=="==w[0].value)var k=!0;var C=t.querySelectorAll('input[value][type="hidden"][name="inbound_form_id"]');C=C.length>0?C[0].value:0;if("undefined"!=typeof landing_path_info)var S=landing_path_info.variation;else if("undefined"!=typeof cta_path_info)var S=cta_path_info.variation;else var S=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:v,last_name:h,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:S,source:n.readCookie("inbound_referral_site"),inbound_submitted:k,inbound_form_id:C,event:t},callback=function(i){e.deBugger("forms","Lead Created with ID: "+i),i=parseInt(i,10),formData.leadID=i,i&&(n.createCookie("wp_lead_id",i),e.totalStorage.deleteItem("page_views"),e.totalStorage.deleteItem("tracking_events")),e.trigger("form_after_submission",formData),e.Forms.releaseFormSubmit(t)},e.trigger("form_before_submission",formData),n.ajaxPost(inbound_settings.admin_url,formData,callback)},rememberInputValues:function(t){var i=(t.name?"inbound_"+t.name:"",t.type?t.type:"text");return"submit"===i||"hidden"===i||"file"===i||"password"===i||t.dataset.ignoreFormField?!1:(n.addListener(t,"change",function(t){if(t.target.name){if("checkbox"!==i)var o=t.target.value;else for(var a=[],r=document.querySelectorAll('input[name="'+t.target.name+'"]'),s=0;s<r.length;s++){var l=r[s].checked;l&&a.push(r[s].value),o=a.join(",")}inputData={name:t.target.name,node:t.target.nodeName.toLowerCase(),type:i,value:o,mapping:t.target.dataset.mapFormField},e.trigger("form_input_change",inputData),n.createCookie("inbound_"+t.target.name,encodeURIComponent(o))}}),void 0)},fillInputValues:function(e){var t=e.name?"inbound_"+e.name:"",i=e.type?e.type:"text";if("submit"===i||"hidden"===i||"file"===i||"password"===i)return!1;if(n.readCookie(t)&&"comment"!=t)if(value=decodeURIComponent(n.readCookie(t)),"checkbox"===i||"radio"===i)for(var o=value.split(","),a=0;a<o.length;a++)e.value.indexOf(o[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:!1},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),i=n.length-1;i>=0;i--)e.dataset.mapFormField||(n[i].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=[],i=t.length-1;i>=0;i--)"label"===t[i].nodeName.toLowerCase()&&n.push(t[i]);return n.length>0&&n.length<2?n:!1},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&&(n.addListener(e,"blur",this.mailCheck),u.run({email:document.querySelector(".inbound-email").value,suggested:function(t){var i=document.querySelector(".email_suggestion");i&&n.removeElement(i);var o=document.createElement("span");o.innerHTML="<span class=\"email_suggestion\">Did youu mean <b><i id='email_correction' style='cursor: pointer;' title=\"click to update\">"+t.full+"</b></i>?</span>",e.parentNode.insertBefore(o,e.nextSibling);var a=document.getElementById("email_correction");n.addListener(a,"click",function(){e.value=a.innerHTML,a.parentNode.parentNode.innerHTML="Fixed!"})},empty:function(){}}))}},"undefined"==typeof 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,i=e.empty||t,o=u.suggest(u.encodeEmail(e.email),e.domains,e.topLevelDomains,e.distanceFunction);return o?n(o):i()},suggest:function(e,t,n,i){e=e.toLowerCase();var o=this.splitEmail(e),a=this.findClosestDomain(o.domain,t,i,this.domainThreshold);if(a){if(a!=o.domain)return{address:o.address,domain:a,full:o.address+"@"+a}}else{var r=this.findClosestDomain(o.topLevelDomain,n,i,this.topLevelThreshold);if(o.domain&&r&&r!=o.topLevelDomain){var s=o.domain;return a=s.substring(0,s.lastIndexOf(o.topLevelDomain))+r,{address:o.address,domain:a,full:o.address+"@"+a}}}return!1},findClosestDomain:function(e,t,n,i){i=i||this.topLevelThreshold;var o,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;o=n(e,t[s]),a>o&&(a=o,r=t[s])}return i>=a&&null!==r?r:!1},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,i=0,o=0,a=0,r=5;n+i<e.length&&n+o<t.length;){if(e.charAt(n+i)==t.charAt(n+o))a++;else{i=0,o=0;for(var s=0;r>s;s++){if(n+s<e.length&&e.charAt(n+s)==t.charAt(n)){i=s;break}if(n+s<t.length&&e.charAt(n)==t.charAt(n+s)){o=s;break}}}n++}return(e.length+t.length)/2-a},splitEmail:function(e){var t=e.trim().split("@");if(t.length<2)return!1;for(var n=0;n<t.length;n++)if(""===t[n])return!1;var i=t.pop(),o=i.split("."),a="";if(0===o.length)return!1;if(1==o.length)a=o[0];else{for(var n=1;n<o.length;n++)a+=o[n]+".";o.length>=2&&(a=a.substring(0,a.length-1))}return{topLevelDomain:a,domain:i,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,i,o){var i=i||{};o=o||{},o.bubbles=o.bubbles||!0,o.cancelable=o.cancelable||!0,i=e.apply_filters("filter_"+t,i);!window.ActiveXObject&&"ActiveXObject"in window;if("function"==typeof CustomEvent)var a=new CustomEvent(t,{detail:i,bubbles:o.bubbles,cancelable:o.cancelable});else{var a=document.createEvent("Event");a.initEvent(t,!0,!0)}window.dispatchEvent(a),e.do_action(t,i),n(t,i)}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(){var e={opt1:!0},n={data:"xyxy"};t("analytics_ready",n,e)},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){var n={clock:e,leadData:InboundLeadData};t("session_heartbeat",n)},page_visit:function(e){t("page_view",e)},page_first_visit:function(){t("page_first_visit"),e.deBugger("pages","First Ever Page View of this Page")},page_revisit:function(n){t("page_revisit",n);var i=function(){console.log("pageData",n),console.log("Page Revisit viewed "+n+" times")};e.deBugger("pages",status,i)},tab_hidden:function(){e.deBugger("pages","Tab Hidden"),t("tab_hidden")},tab_visible:function(){e.deBugger("pages","Tab Visible"),t("tab_visible")},tab_mouseout:function(){e.deBugger("pages","Tab Mouseout"),t("tab_mouseout")},form_input_change:function(n){var i=function(){console.log(n)};e.deBugger("forms","inputData change. Data=",i),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)},analyticsError:function(e,t,n){var i=new CustomEvent("inbound_analytics_error",{detail:{MLHttpRequest:e,textStatus:t,errorThrown:n}});window.dispatchEvent(i),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,i="_inbound";if("localStorage"in window)try{n="undefined"==typeof window.localStorage?void 0:window.localStorage,t="undefined"==typeof n||"undefined"==typeof window.JSON?!1:!0,window.localStorage.setItem(i,"1"),window.localStorage.removeItem(i)}catch(o){t=!1}e.totalStorage=function(t,n){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"undefined"!=typeof t?this.setItem(e,t):this.getItem(e)},setItem:function(i,o){if(!t)try{return e.Utils.createCookie(i,o),o}catch(a){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 r=JSON.stringify(o);return n.setItem(i,r),this.parseResult(r)},getItem:function(i){if(!t)try{return this.parseResult(e.Utils.readCookie(i))}catch(o){return null}var a=n.getItem(i);return this.parseResult(a)},deleteItem:function(i){if(!t)try{return e.Utils.eraseCookie(i,null),!0}catch(o){return!1}return n.removeItem(i),!0},getAll:function(){var i=[];if(t)for(var o in n)o.length&&i.push({key:o,value:this.parseResult(n.getItem(o))});else try{for(var a=document.cookie.split(";"),r=0;r<a.length;r++){var s=a[r].split("="),l=s[0];i.push({key:l,value:this.parseResult(e.Utils.readCookie(l))})}}catch(u){return null}return i},parseResult:function(e){var t;try{t=JSON.parse(e),"undefined"==typeof t&&(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")),i=t.readCookie("lead_session_expire");i||(e.deBugger("leads","expired vistor. Run Processes"),n&&e.LeadsAPI.getAllLeadData())},setGlobalLeadData:function(e){InboundLeadData=e},getAllLeadData:function(){var t=e.Utils.readCookie("wp_lead_id"),n=e.totalStorage("inbound_lead_data"),i=e.Utils.readCookie("lead_data_expire");
3
data={action:"inbound_get_all_lead_data",wp_lead_id:t},success=function(t){var n=JSON.parse(t);e.LeadsAPI.setGlobalLeadData(n),e.totalStorage("inbound_lead_data",n);var i=new Date;i.setTime(i.getTime()+18e5);var o=e.Utils.addDays(i,3);e.Utils.createCookie("lead_data_expire",!0,o)},n?(e.LeadsAPI.setGlobalLeadData(n),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=e.Utils.readCookie("wp_lead_id"),n={action:"wpl_check_lists",wp_lead_id:t},i=function(){e.Utils.createCookie("lead_session_list_check",!0,{path:"/",expires:1}),e.deBugger("lead","Lists checked")};e.Utils.ajaxPost(inbound_settings.admin_url,n,i)}},e}(_inbound||{}),_inboundPageTracking=function(e){var t,n,i=!1,o=!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,v=e.Settings.timeout||1e4;return e.PageTracking={init:function(i){return"page_views"!==f?!1:(this.CheckTimeOut(),i=i||{},t=parseInt(i.reportInterval,10)||10,n=parseInt(i.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(),void 0)},setIdle:function(t){var t=t||"No Movement",n="Session IDLE. Activity Timeout due to "+t;e.deBugger("pages",n),clearTimeout(e.PageTracking.idleTimer),e.PageTracking.stopClock(),e.trigger("session_idle")},checkVisibility:function(){var t,n,i;"undefined"!=typeof document.hidden?(t="hidden",i="visibilitychange",n="visibilityState"):"undefined"!=typeof document.mozHidden?(t="mozHidden",i="mozvisibilitychange",n="mozVisibilityState"):"undefined"!=typeof document.msHidden?(t="msHidden",i="msvisibilitychange",n="msVisibilityState"):"undefined"!=typeof document.webkitHidden&&(t="webkitHidden",i="webkitvisibilitychange",n="webkitVisibilityState");var o=document[t];e.Utils.addListener(document,i,function(){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(){r+=1;var n=r/60,i="Total time spent on Page in this Session: "+n.toFixed(2)+" min";if(e.deBugger("pages",i),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(){s+=1;var t=(1800-s)/60,n="Time until Session Timeout: "+t.toFixed(2)+" min";e.deBugger("pages",n),s>1800&&(e.trigger("session_end",InboundLeadData),e.Utils.eraseCookie("lead_session"),s=0,clearTimeout(u))},stopClock:function(){o=!0,clearTimeout(l),clearTimeout(u),u=setInterval(e.PageTracking.inactiveClock,1e3)},restartClock:function(){o=!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;i=!0,l=setInterval(e.PageTracking.clock,1e3);var t=c.readCookie("lead_session");if(t)e.trigger("session_active");else{e.trigger("session_start");var n=new Date;n.setTime(n.getTime()+18e5),e.Utils.createCookie("lead_session",1,n)}this.pingSession()},resetInactiveFunc:function(){s=0,clearTimeout(u)},pingSession:function(t){a||(i||e.PageTracking.startSession(),o&&e.PageTracking.restartClock(),clearTimeout(d),d=setTimeout(e.PageTracking.setIdle,1e3*n+100),"undefined"!=typeof t&&"mousemove"===t.type&&e.PageTracking.mouseEvents(t))},mouseEvents:function(t){t.pageY<=5&&e.trigger("tab_mouseout")},getPageViews:function(){var t=e.Utils.checkLocalStorage();if(t){var n=localStorage.getItem(f),i=JSON.parse(n);return i}},isRevisit:function(e){var t=!1,e=e||{},n=e[p];return"undefined"!=typeof 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,i=this.isRevisit(g);if(i){var o=g[p].length-1,a=g[p][o],r=Math.abs(new Date(a).getTime()-new Date(m).getTime());n=r>v,n?(t="Timeout Happened. Page view fired",this.triggerPageView(i)):(time_left=.001*Math.abs(v-r),t=v/1e3+" sec timeout not done: "+time_left+" seconds left")}else this.triggerPageView(i);e.deBugger("pages",t)},storePageView:function(){if("off"!=inbound_settings.page_tracking){var t=e.Utils.readCookie("wp_lead_id")?e.Utils.readCookie("wp_lead_id"):"",n=e.Utils.readCookie("wp_lead_uid")?e.Utils.readCookie("wp_lead_uid"):"",i={action:"inbound_track_lead",wp_lead_uid:n,wp_lead_id:t,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()),json:"0"},o=function(){};e.Utils.ajaxPost(inbound_settings.admin_url,i,o)}}},e}(_inbound||{});_inbound.init(),InboundLeadData=_inbound.totalStorage("inbound_lead_data")||null;
shared/classes/class.events.php CHANGED
@@ -281,6 +281,10 @@ class Inbound_Events {
281
self::store_event($args);
282
}
283
284
public static function store_event( $args ) {
285
global $wpdb;
286
@@ -626,17 +630,41 @@ class Inbound_Events {
626
627
}
628
629
630
/**
631
* Get visitor count given page_id
632
*
633
*/
634
- public static function get_visitors_count( $page_id ){
635
global $wpdb;
636
637
$table_name = $wpdb->prefix . "inbound_page_views";
638
639
- $query = 'SELECT * FROM '.$table_name.' WHERE `page_id` = "'.$page_id.'" GROUP BY lead_id';
640
641
$results = $wpdb->get_results( $query , ARRAY_A );
642
@@ -801,6 +829,7 @@ class Inbound_Events {
801
802
803
}
804
/**
805
* Get all mute events given a lead id
806
*/
@@ -933,7 +962,7 @@ class Inbound_Events {
933
* @param string $activity
934
* @return datetime or null
935
*/
936
- public static function get_total_activity($lead_id , $activity = 'any' ){
937
global $wpdb;
938
939
$table_name = $wpdb->prefix . "inbound_events";
@@ -947,6 +976,11 @@ class Inbound_Events {
947
break;
948
}
949
950
/* return latest activity if recorded */
951
$count = $wpdb->get_var( $query , 0, 0 );
952
281
self::store_event($args);
282
}
283
284
+ /**
285
+ * Add event to inbound_events table
286
+ * @param $args
287
+ */
288
public static function store_event( $args ) {
289
global $wpdb;
290
630
631
}
632
633
+ /**
634
+ * Get sources given lead_id
635
+ *
636
+ */
637
+ public static function get_lead_sources( $lead_id ){
638
+ global $wpdb;
639
+
640
+ $table_name = $wpdb->prefix . "inbound_events";
641
+
642
+ $query = 'SELECT *, count(*) as count FROM '.$table_name.' WHERE `lead_id` = "'.$lead_id.'" GROUP BY source';
643
+
644
+ $results = $wpdb->get_results( $query , ARRAY_A );
645
+
646
+ return $results;
647
+
648
+ }
649
+
650
651
/**
652
* Get visitor count given page_id
653
*
654
*/
655
+ public static function get_visitors_count( $page_id , $params = array() ){
656
global $wpdb;
657
658
$table_name = $wpdb->prefix . "inbound_page_views";
659
660
+ $query = 'SELECT * FROM '.$table_name.' WHERE `page_id` = "'.$page_id.'" ';
661
+
662
+ if (isset($params['start_date'])) {
663
+ $query .= 'AND datetime >= "'.$params['start_date'].'" AND datetime <= "'.$params['end_date'].'" ';
664
+ }
665
+
666
+ $query .='GROUP BY lead_uid';
667
+
668
669
$results = $wpdb->get_results( $query , ARRAY_A );
670
829
830
831
}
832
+
833
/**
834
* Get all mute events given a lead id
835
*/
962
* @param string $activity
963
* @return datetime or null
964
*/
965
+ public static function get_total_activity($lead_id , $activity = 'any' , $blacklist = array() ){
966
global $wpdb;
967
968
$table_name = $wpdb->prefix . "inbound_events";
976
break;
977
}
978
979
+ /* add blacklist queries */
980
+ foreach ($blacklist as $event_name ) {
981
+ $query .= ' AND `event_name` != "'.$event_name.'"';
982
+ }
983
+
984
/* return latest activity if recorded */
985
$count = $wpdb->get_var( $query , 0, 0 );
986
shared/classes/class.form.php CHANGED
@@ -549,111 +549,111 @@ if (!class_exists('Inbound_Forms')) {
549
return;
550
}
551
/* TODO remove this */
552
- echo '<script type="text/javascript">
553
-
554
- jQuery(document).ready(function($){
555
-
556
- jQuery(".inbound-now-form").submit(function(e) {
557
-
558
- /* added below condition for check any of checkbox checked or not by kirit dholakiya */
559
- if( jQuery(\'.checkbox-required\')[0] && jQuery(\'.checkbox-required input[type=checkbox]:checked\').length==0)
560
- {
561
- jQuery(\'.checkbox-required input[type=checkbox]:first\').focus();
562
- alert("' . __('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') . '");
563
- e.preventDefault();
564
- e.stopImmediatePropagation();
565
- }
566
- jQuery(this).find("input").each(function(){
567
- if(!jQuery(this).prop("required")){
568
- } else if (!jQuery(this).val()) {
569
- alert("' . __('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') . '");
570
-
571
- e.preventDefault();
572
- e.stopImmediatePropagation();
573
- return false;
574
- }
575
- });
576
-
577
- /*Disable button and add spinner to form*/
578
-
579
- var target = jQuery(this).find("#inbound_form_submit"),
580
- spinnerColor = jQuery(target).css("color"),
581
- buttonWidth = jQuery(target).css("width"),
582
- buttonHeight = jQuery(target).css("height"),
583
- scale = jQuery(target).css("font-size");
584
- scale = scale.replace("px", "");
585
- scale = scale / 40;
586
-
587
-
588
- //spinner
589
- var opts = {
590
- lines: 8 // The number of lines to draw
591
- , length: 0 // The length of each line
592
- , width: 7 // The line thickness
593
- , radius: 25 // The radius of the inner circle
594
- , scale: scale // Scales overall size of the spinner
595
- , corners: 1 // Corner roundness (0..1)
596
- , color: spinnerColor // #rgb or #rrggbb or array of colors
597
- , opacity: 0.25 // Opacity of the lines
598
- , rotate: 0 // The rotation offset
599
- , direction: 1 // 1: clockwise, -1: counterclockwise
600
- , speed: 1 // Rounds per second
601
- , trail: 60 // Afterglow percentage
602
- , fps: 20 // Frames per second when using setTimeout() as a fallback for CSS
603
- , zIndex: 2e9 // The z-index (defaults to 2000000000)
604
- , className: "inbound-form-spinner" // The CSS class to assign to the spinner
605
- , top: "50%" // Top position relative to parent
606
- , left: "50%" // Left position relative to parent
607
- , shadow: false // Whether to render a shadow
608
- , hwaccel: false // Whether to use hardware acceleration
609
- , position: "absolute" // Element positioning
610
- }
611
-
612
- jQuery(target).prop("disabled",true).html("").css({"width" : buttonWidth, "height" : buttonHeight});
613
-
614
- var spinner = new Spinner(opts).spin(target[0]);
615
-
616
-
617
- });
618
-
619
- jQuery("#inbound_form_submit br").remove(); /* remove br tags */
620
- function validateEmail(email) {
621
-
622
- var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))#x2F;;
623
- return re.test(email);
624
- }
625
- var parent_redirect = parent.window.location.href;
626
- jQuery("#inbound_parent_page").val(parent_redirect);
627
-
628
-
629
- /* validate email */
630
- jQuery("input.inbound-email").on("change keyup", function (e) {
631
- var $this = jQuery(this);
632
- var email = $this.val();
633
- jQuery(".inbound_email_suggestion").remove();
634
- if (validateEmail(email)) {
635
- $this.css("color", "green");
636
- $this.addClass("inbound-valid-email");
637
- $this.removeClass("inbound-invalid-email");
638
- } else {
639
- $this.css("color", "red");
640
- $this.addClass("inbound-invalid-email");
641
- $this.removeClass("inbound-valid-email");
642
- }
643
- if($this.hasClass("inbound-valid-email")) {
644
- $this.parent().parent().find("#inbound_form_submit").removeAttr("disabled");
645
- }
646
- });
647
-
648
- /* Trims whitespace on advancing to the next input */
649
- jQuery("input[type=\'text\']").on("blur", function() {
650
- var value = jQuery.trim( $(this).val() );
651
- jQuery(this).val( value );
652
- })
653
-
654
-
655
- });
656
- </script>';
657
658
}
659
@@ -810,7 +810,7 @@ if (!class_exists('Inbound_Forms')) {
810
}
811
812
/* If there's no notification email in place then bail */
813
- if (!isset($form_meta_data['inbound_notify_email'])) {
814
return;
815
}
816
@@ -948,9 +948,9 @@ if (!class_exists('Inbound_Forms')) {
948
$content = apply_filters('the_content', $content);
949
$content = str_replace(']]>', ']]&gt;', $content);
950
951
- $confirm_email_message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html;' . get_option('blog_charset') . '" /></head><body style="margin: 0px; background-color: #F4F3F4; font-family: Helvetica, Arial, sans-serif; font-size:12px;" text="#444444" bgcolor="#F4F3F4" link="#21759B" alink="#21759B" vlink="#21759B" marginheight="0" topmargin="0" marginwidth="0" leftmargin="0"><table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff" border="0"><tr>';
952
- $confirm_email_message .= $content;
953
- $confirm_email_message .= '</tr></table></body></html>';
954
955
956
$confirm_subject = apply_filters('inbound_lead_conversion/subject', $confirm_subject, $form_meta_data, $form_post_data);
549
return;
550
}
551
/* TODO remove this */
552
+ ?>
553
+ <script type="text/javascript">
554
+ _inbound.add_action( 'form_before_submission', inbound_additional_checks, 10);
555
+
556
+ function inbound_additional_checks( data ) {
557
+ /* make sure event is defined */
558
+ if (typeof event == 'undefined') {
559
+ var event = {};
560
+ event.target = data.event;
561
+ }
562
+
563
+ /* added below condition for check any of checkbox checked or not by kirit dholakiya */
564
+ if( jQuery('.checkbox-required')[0] && jQuery('.checkbox-required input[type=checkbox]:checked').length==0) {
565
+ jQuery('.checkbox-required input[type=checkbox]:first').focus();
566
+ alert("<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') ; ?> ");
567
+ throw new Error('<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') ; ?>');
568
+ }
569
+
570
+ jQuery(this).find("input").each(function(){
571
+ if(!jQuery(this).prop("required")){
572
+ } else if (!jQuery(this).val()) {
573
+ alert("<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro'); ?>");
574
+ throw new Error('<?php _e('Oops! Looks like you have not filled out all of the required fields!', 'inbound-pro') ; ?>');
575
+ }
576
+ });
577
+
578
+ /*Disable button and add spinner to form*/
579
+ var target = jQuery(event.target).find("#inbound_form_submit"),
580
+ spinnerColor = jQuery(target).css("color"),
581
+ buttonWidth = jQuery(target).css("width"),
582
+ buttonHeight = jQuery(target).css("height"),
583
+ scale = jQuery(target).css("font-size");
584
+ scale = scale.replace("px", "");
585
+ scale = scale / 40;
586
+
587
+
588
+ /* spinner param setup */
589
+ var opts = {
590
+ lines: 8 // The number of lines to draw
591
+ , length: 0 // The length of each line
592
+ , width: 7 // The line thickness
593
+ , radius: 25 // The radius of the inner circle
594
+ , scale: scale // Scales overall size of the spinner
595
+ , corners: 1 // Corner roundness (0..1)
596
+ , color: spinnerColor // #rgb or #rrggbb or array of colors
597
+ , opacity: 0.25 // Opacity of the lines
598
+ , rotate: 0 // The rotation offset
599
+ , direction: 1 // 1: clockwise, -1: counterclockwise
600
+ , speed: 1 // Rounds per second
601
+ , trail: 60 // Afterglow percentage
602
+ , fps: 20 // Frames per second when using setTimeout() as a fallback for CSS
603
+ , zIndex: 2e9 // The z-index (defaults to 2000000000)
604
+ , className: "inbound-form-spinner" // The CSS class to assign to the spinner
605
+ , top: "50%" // Top position relative to parent
606
+ , left: "50%" // Left position relative to parent
607
+ , shadow: false // Whether to render a shadow
608
+ , hwaccel: false // Whether to use hardware acceleration
609
+ , position: "absolute" // Element positioning
610
+ };
611
+
612
+ jQuery(target).prop("disabled",true).html("").css({"width" : buttonWidth, "height" : buttonHeight});
613
+
614
+ var spinner = new Spinner(opts).spin(target[0]);
615
+
616
+ }
617
+
618
+ /* helper function for validating email */
619
+ function inboundFormsVaidateEmail(email) {
620
+ var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))#x2F;;
621
+ return re.test(email);
622
+ }
623
+
624
+ /* Adding helpful listeners - may need to move all this into the analytics engine */
625
+ jQuery(document).ready(function($){
626
+ /* remove br tags */
627
+ jQuery("#inbound_form_submit br").remove();
628
+
629
+ /* validate email */
630
+ jQuery("input.inbound-email").on("change keyup", function (e) {
631
+ var $this = jQuery(this);
632
+ var email = $this.val();
633
+ jQuery(".inbound_email_suggestion").remove();
634
+ if (inboundFormsVaidateEmail(email)) {
635
+ $this.css("color", "green");
636
+ $this.addClass("inbound-valid-email");
637
+ $this.removeClass("inbound-invalid-email");
638
+ } else {
639
+ $this.css("color", "red");
640
+ $this.addClass("inbound-invalid-email");
641
+ $this.removeClass("inbound-valid-email");
642
+ }
643
+ if($this.hasClass("inbound-valid-email")) {
644
+ $this.parent().parent().find("#inbound_form_submit").removeAttr("disabled");
645
+ }
646
+ });
647
+
648
+ /* Trims whitespace on advancing to the next input */
649
+ jQuery("input[type='text']").on("blur", function() {
650
+ var value = jQuery.trim( $(this).val() );
651
+ jQuery(this).val( value );
652
+ })
653
+
654
+ });
655
+ </script>
656
+ <?php
657
658
}
659
810
}
811
812
/* If there's no notification email in place then bail */
813
+ if (!isset($form_meta_data['inbound_notify_email']) || !trim($form_meta_data['inbound_notify_email'])) {
814
return;
815
}
816
948
$content = apply_filters('the_content', $content);
949
$content = str_replace(']]>', ']]&gt;', $content);
950
951
+ //$confirm_email_message = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html;' . get_option('blog_charset') . '" /></head><body style="margin: 0px; background-color: #F4F3F4; font-family: Helvetica, Arial, sans-serif; font-size:12px;" text="#444444" bgcolor="#F4F3F4" link="#21759B" alink="#21759B" vlink="#21759B" marginheight="0" topmargin="0" marginwidth="0" leftmargin="0"><table cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff" border="0"><tr>';
952
+ $confirm_email_message = $content;
953
+ //$confirm_email_message .= '</tr></table></body></html>';
954
955
956
$confirm_subject = apply_filters('inbound_lead_conversion/subject', $confirm_subject, $form_meta_data, $form_post_data);
shared/classes/class.lead-storage.php CHANGED
@@ -297,7 +297,7 @@ if (!class_exists('LeadStorage')) {
297
298
299
/* update custom field options for dropdown */
300
- if (isset($field['type']) == 'dropdown' ) {
301
$options = $inbound_settings['leads-custom-fields']['fields'][ $key ][ 'options' ];
302
303
if ( !isset($options[ $value ]) ) {
@@ -468,14 +468,14 @@ if (!class_exists('LeadStorage')) {
468
global $wpdb;
469
470
$table_name = $wpdb->prefix . "inbound_page_views";
471
-
472
$args = array(
473
'lead_id' => $lead['id'],
474
);
475
476
$array = array(
477
'lead_id' => 0,
478
- 'lead_uid' => (isset($lead['wp_lead_uid'])) ? $lead['wp_lead_uid'] : $_COOKIE["wp_lead_uid"]
479
);
480
481
/* update inbound_page_view page view records associated with lead */
@@ -484,7 +484,7 @@ if (!class_exists('LeadStorage')) {
484
$args,
485
array(
486
'lead_id' => 0,
487
- 'lead_uid' => (isset($lead['wp_lead_uid'])) ? $lead['wp_lead_uid'] : $_COOKIE["wp_lead_uid"]
488
),
489
array(
490
'%d',
297
298
299
/* update custom field options for dropdown */
300
+ if (isset($field['type']) && $field['type']== 'dropdown' ) {
301
$options = $inbound_settings['leads-custom-fields']['fields'][ $key ][ 'options' ];
302
303
if ( !isset($options[ $value ]) ) {
468
global $wpdb;
469
470
$table_name = $wpdb->prefix . "inbound_page_views";
471
+ $lead_uid_cookie = (isset($_COOKIE["wp_lead_uid"])) ? $_COOKIE["wp_lead_uid"] : '';
472
$args = array(
473
'lead_id' => $lead['id'],
474
);
475
476
$array = array(
477
'lead_id' => 0,
478
+ 'lead_uid' => (isset($lead['wp_lead_uid'])) ? $lead['wp_lead_uid'] : $lead_uid_cookie
479
);
480
481
/* update inbound_page_view page view records associated with lead */
484
$args,
485
array(
486
'lead_id' => 0,
487
+ 'lead_uid' => (isset($lead['wp_lead_uid'])) ? $lead['wp_lead_uid'] : $lead_uid_cookie
488
),
489
array(
490
'%d',