PageSourceSearch

https://www.sitemodify.com/common/scripts/dm.trackstats.jsp?v=2026-09-24T12_50_33

js sitemodify.com collected 2026-09-24 18:42:52 UTC 21,264 bytes, 572 lines download raw bytes

1
2    
3
4
5    
6    var mixpanel = [];
7    mixpanel.track = function () {
8    };
9    mixpanel.identify = function () {
10    };
11    mixpanel.name_tag = function () {
12    };
13    mixpanel.register = function () {
14    };
15
16    var dataLayer = dataLayer || [];
17
18    
19
20    var MIXPANEL_CUSTOM_LIB_URL = "https://mp.multiscreensite.com/lib.min.js";
21
22
23    (function (e, b) {
24        if (!b.__SV) {
25            var a, f, i, g;
26            window.mixpanel = b;
27            a = e.createElement("script");
28            a.type = "text/javascript";
29            a.async = !0;
30            a.src = ("https:" === e.location.protocol ? "https:" : "http:") + '//cdn.mxpnl.com/libs/mixpanel-2.2.min.js';
31            f = e.getElementsByTagName("script")[0];
32            f.parentNode.insertBefore(a, f);
33            b._i = [];
34            b.init = function (a, e, d) {
35                function f(b, h) {
36                    var a = h.split(".");
37                    2 == a.length && (b = b[a[0]], h = a[1]);
38                    b[h] = function () {
39                        b.push([h].concat(Array.prototype.slice.call(arguments, 0)))
40                    }
41                }
42
43                var c = b;
44                "undefined" !==
45                typeof d ? c = b[d] = [] : d = "mixpanel";
46                c.people = c.people || [];
47                c.toString = function (b) {
48                    var a = "mixpanel";
49                    "mixpanel" !== d && (a += "." + d);
50                    b || (a += " (stub)");
51                    return a
52                };
53                c.people.toString = function () {
54                    return c.toString(1) + ".people (stub)"
55                };
56                i = "disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.increment people.append people.track_charge people.clear_charges people.delete_user".split(
57                    " ");
58                for (g = 0; g < i.length; g++) f(c, i[g]);
59                b._i.push([a, e, d])
60            };
61            b.__SV = 1.2
62        }
63    })(document, window.mixpanel || []);
64
65
66    const mpSettings = {
67        'persistence': 'localStorage',
68        'record_block_selector': 'video',
69        'record_mask_text_selector': '#stripePopupWrapper,[autocomplete^=cc-],[data-auto="client-info-cell"],[data-auto="client-profile-body"],#add_client_popup_keyWrapper,[data-tab-id="submission"],#deleteFormResponses,#stripePopupWrapper',
70        'record_mask_input_selector': 'input[type=password],input[type=hidden],input[autocomplete^=cc-]',
71        'record_heatmap_data': window._flags['mixpanel.recording.heatmap.enabled']
72    };
73    mpSettings['api_host'] = 'https://mp.multiscreensite.com';
74
75    mixpanel.init("95ad53f6a4af65dcf1815ef6bff3ca19", mpSettings);
76    
77
78    const recordingEnabled =
79        window._flags?.['mixpanel.recording.enabled'] ||
80        window.location.href.includes('home/widgetBuilder') ||
81        [
82            { flag: 'mixpanel.recording.dashboard.enabled', path: 'home/dashboard' }
83        ].some(({ flag, path }) =>
84            window._flags?.[flag] && window.location.href.includes(path)
85        ) ||
86        (window._flags?.['mixpanel.recording.dashboard.enabled'] && window.location.pathname.endsWith('/home'))
87
88
89    if(recordingEnabled) {
90        setTimeout(() => {
91            mixpanel?.start_session_recording?.();
92        }, 2000);
93    }
94
95
96    
97
98
99    var ACCOUNT_CREATED = "Account Created";
100    var SITE_PUBLISHED = "Site Published";
101    var SITE_REPUBLISHED = "Site Re-Published";
102    var SITE_NEW_CLICKED = "New Site Clicked";
103    var SITE_NEW_CREATED = "New Site Created";
104    var FAQ_READ = "Read FAQ";
105    var BLOG_READ = "Read Blog";
106    var SUPPORT_CLICKED = "Support Clicked";
107    var STATS_CLICKED = "Stats Clicked";
108    var SITE_UPGRADE_CLICKED = "Site Upgrade Clicked";
109    var SITE_PAYMENT_CLICKED = "Site Payment Clicked";
110    var SITE_UPGRADED = "Site Upgraded";
111    var SITE_DOWNGRADED = "Site Downgraded";
112    var SITE_DELETED = "Site Deleted";
113    var SITE_EDIT_TEMPLATES = "Site edit templates";
114    var CHANGE_TEMPLATE = "Site change template";
115    var SITE_EDIT_DESIGN = "Site edit design";
116    var SITE_EDIT_FEATURES = "Site edit features";
117    var SITE_EDIT_REVIEW_PUBLISH = "Site review publish";
118    var SITE_EDIT_SETUP_REDIRECT = "site setup redirect";
119    var ACCOUNT_ACTIVITY = "Account activity";
120    var SIGNUP = "Account Created via signup";
121    var INVALID_SITE_URL = "Invalid site URL";
122
123    var WR_SITE_SELECT_THEMES = "WR_site_select_themes";
124    var WR_SITE_CHANGE_THEME = "WR_site_change_theme";
125    var WR_SITE_EDIT_SITE = "WR_site_edit_design";
126    var WR_SITE_EDIT_SWITCH_FULL = "WR_site_edit_switch_full";
127    var WR_SITE_EDIT_SWITCH_BASIC = "WR_site_edit_switch_basic";
128    var WR_SITE_REVIEW_PUBLISH = "WR_site_review_publish";
129    var WR_SITE_REVIEW_PUBLISH_ACCOUNT_BOX = "WR_site_review_publish_account_box";
130    var WR_SITE_REVIEW_PUBLISH_NO_PLAN = "WR_site_review_publish_no_plan";
131    var WR_SITE_REVIEW_PUBLISH_WITH_PLAN = "WR_site_review_publish_with_plan";
132    var WR_SITE_VIEW_REDIRECT = "WR_site_view_redirect";
133    var WR_SITE_DESIGN_SECTION = "WR_site_design_section";
134    var WR_SITE_ADD_WIDGET = "WR_site_add_widget";
135    var WR_SITE_EDIT_WIDGET = "WR_site_edit_widget";
136    var WR_SITE_NAV_SHAPE_CHANGE = "WR_site_change_nav_shape";
137
138    var WR_SITE_REMOVE_ADS_CLICKED = "WR_site_remove_ads_clicked";
139    var WR_SITE_REMOVE_ADS_UPGRADE_NOW = "WR_site_remove_ads_now";
140    var WR_SITE_REMOVE_ADS_UPGRADE_LATER = "WR_site_remove_ads_later";
141    var WR_SITE_REMOVE_FOOTER_CLICKED = "WR_site_remove_footer_clicked";
142    var WR_SITE_REMOVE_FOOTER_UPGRADE_NOW = "WR_site_remove_footer_now";
143    var WR_SITE_REMOVE_FOOTER_UPGRADE_LATER = "WR_site_remove_footer_later";
144    var WR_SITE_OPEN_MANAGE_SUBS = "WR_site_open_manage_subs";
145    var WR_SITE_CANCEL_SUBS_FIRST = "WR_site_cancel_subs_first";
146    var WR_SITE_CANCEL_SUBS_SECOND = "WR_site_cancel_subs_second";
147    var WR_SITE_KEEP_SUBS_FIRST = "WR_site_keep_subs_first";
148    var WR_SITE_KEEP_SUBS_SECOND = "WR_site_keep_subs_second";
149    var WR_SITE_CHANGE_DOWNGRADE_REASON = "WR_site_change_downgrade_reason";
150    var WR_SITE_CLICK_DOWNGRADE_TIP = "WR_site_click_downgrade_tip";
151
152    var WR_SITE_UPGRADED = "WR_site_upgraded";
153    var WR_SITE_PUBLISHED = "WR_site_published";
154    var WR_SITE_REPUBLISHED = "WR_site_republished";
155    var WR_SITE_PREMIUM_PURCHASED = "WR_site_premium_purchased";
156    var WR_CREATE_ACCOUNT_FIRST = "WR_create_account_first";
157    var WR_SITE_CREATE_ACCOUNT = "WR_site_create_account";
158    var WR_SITE_OPEN_CREATE_ACCOUNT = "WR_site_open_create_account";
159    var WR_SITE_REVIEW_PUBLISH_NEW_USER = "WR_site_review_publish_new_user";
160    var WR_NEW_USER_SITE_CREATED = "WR_new_user_site_created";
161    var WR_NEW_USER_ENTER_URL = "WR_new_user_enter_url";
162    var WR_NEW_USER_ERROR_CREATING_SITE = "WR_new_user_error_creating_site";
163    var WR_EXISTING_USER_SITE_CREATED = "WR_existing_user_site_created";
164    var WR_EXISTING_USER_ERROR_CREATING_SITE = "WR_existing_user_error_creating_site";
165    var WR_EXISTING_USER_ENTER_URL = "WR_existing_user_enter_url";
166
167    var PT_GO_REDIRECT = "PT_goto_redirect";
168    var PT_GO_GOLIVE = "PT_goto_golive";
169    var PT_GO_PLIMUS = "PT_goto_plimus";
170    var PT_GO_PAGES = "PT_goto_pages";
171    var PT_GO_LAYOUT = "PT_goto_layout";
172    var PT_GO_HEADER = "PT_goto_header";
173    var PT_GO_STYLE = "PT_goto_style";
174    var PT_NEW_PAGE = "PT_new_page";
175    var PT_NEW_USER_SITE_CREATED = "pt_newuser_site_created";
176    var PT_EXISTING_USER_SITE_CREATED = "pt_existinguser_site_created";
177    var PT_SITE_CREATED = "pt_site_created";
178
179    var NEW_SITE_CREATE_ACCOUNT_POPUP = "New Site Create Account Popup";
180    var NEW_SITE_ENTERED_URL = "New Site Entered Url";
181
182    var SITE_CREATE_ACCOUNT = "site_create_account";
183    var DM_SITE_CREATE_ACCOUNT = "dm_site_create_account";
184    var D1_SITE_CREATE_ACCOUNT = "d1_site_create_account";
185    var D1_SITE_PURCHASED = "d1_site_purchased";
186    var D1_SITE_CANCEL_SUBS_FIRST = "d1_site_cancel_subs_first";
187    var D1_SITE_CANCEL_SUBS_SECOND = "d1_site_cancel_subs_second";
188    var D1_SITE_DOWNGRADE_TO_BUSINESS = "d1_site_downgrade_to_business";
189
190    var _trackCreatedViaIframe = false;
191
192    var campaignCookies = ['_dm_utm_source', '_dm_utm_medium', '_dm_utm_campaign'];
193
194    function wrTrackEvent(event, params) {
195        params = params || {};
196
197        // fix for invoking with (event, eventname, eventvalue)
198        params = getFnParameters(Array.prototype.slice.call(arguments));
199
200        var productType = "", isFromScratch = "", siteAlias = "", externalUID = null;
201
202        if ($.dmx && $.dmx.site) {
203
204            productType = $.dmx.site.dmProductType;
205            isFromScratch = $.dmx.site.isFromScratch;
206            siteAlias = $.dmx.site.alias;
207            externalUID = $.dmx.site.externalUID;
208        }
209        params = $.extend({
210            product: productType,
211            isBFS: isFromScratch,
212            externalUID: externalUID
213
214        }, params);
215        dmTrackEvent(event, "siteAlias", siteAlias, params);
216    }
217
218// DO NOT ADD GLOBAL VARIABLES, prefer passing it with the params since initHallDashboard.jsp does not bring all the global variables as commonHead.jsp do.
219    function edTrackEvent(event, params) {
220        params = params || {};
221
222        // fix for invoking with (event, eventname, eventvalue)
223        params = getFnParameters(Array.prototype.slice.call(arguments));
224
225        var siteAlias = "";
226        var sitePlan = "";
227        var siteCreationDate = null;
228        var isPublished = false;
229        var externalUID = null;
230        var isFlexEditor = false;
231        var siteStatus = null;
232        var siteCreationMethod = null;
233        var blogId = null;
234        var widgetId = null;
235
236        if ($.dmx && $.dmx.site) {
237            siteAlias = $.dmx.site.alias;
238            sitePlan = $.dmx.site.planId;
239            siteCreationDate = $.dmx.site.creationDate;
240            isPublished = $.dmx.site.isPublished;
241            externalUID = $.dmx.site.externalUID;
242            siteStatus = $.dmx.site.status;
243            siteCreationMethod = $.dmx.site.creationMethod || null;
244            blogId = $.dmx.site.blogId;
245        }
246        if ($.dmx && $.dmx.siteRuntimeFlags) {
247            isFlexEditor = $.dmx.siteRuntimeFlags.FLEX_SITE;
248        }
249        if ($.dmx && $.dmx.widget) {
250            widgetId = $.dmx.widget.id;
251        }
252        params = $.extend({
253            isMobileDevice: window.isMobileDevice,
254            sitePlanId: sitePlan,
255            siteCreationDate: siteCreationDate,
256            published: isPublished,
257            externalUID: externalUID,
258            isFlexEditor: isFlexEditor,
259            'site-status': siteStatus ? (siteStatus === 'IN_PLANNING' ? 'Planning' : 'Site') : null,
260            'site-creation-method': siteCreationMethod,
261            hasBlog: !!blogId,
262            'widget-id': widgetId
263        }, params);
264        dmTrackEvent(event, "siteAlias", siteAlias, params);
265    }
266
267    function getFnParameters(args) {
268        args = args || [];
269        var key = args[1] || {};
270        if (typeof key == 'string' || key instanceof String) {
271            var value = args[2], additionalParams = args[3] || {}, paramsObject = {};
272
273            paramsObject[key] = value;
274            return $.extend(paramsObject, additionalParams);
275        }
276
277        return key;
278    }
279
280    function dmTrackNewUser(alias) {
281        try {
282            _clientTrackIdentifyFromCookie();
283            mixpanel.alias(alias);
284            mixpanel.instance2?.alias(alias);
285        } catch (e) {
286        }
287    }
288
289    function dmTrackSuperProperty(json) {
290        mixpanel.register(json);
291        mixpanel.instance2?.register(json);
292    }
293
294    function uuidv4() {
295        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
296            var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
297            return v.toString(16);
298        });
299    }
300
301
302    function dmTrackIdentity({uuid, name, isReseller, isCustomer, isProTrial, moreProperties}) {
303
304        try {
305
306            mixpanel.identify(uuid);
307            mixpanel.instance2?.identify(uuid);
308            mixpanel.name_tag(uuid);
309            mixpanel.instance2?.name_tag(uuid);
310            // This is important for backwards compatability - we alias the old id we were using (name) to the new id we are now using (uuid)
311            mixpanel.alias(uuid, name);
312            mixpanel.instance2?.alias(uuid, name);
313
314            var userType = 'smb';
315            if (isReseller) {
316                userType = 'reseller';
317            } else if (isCustomer) {
318                userType = 'customer';
319            }
320            mixpanel.register({
321                'user_type': userType,
322                'isInProTrial': isProTrial ? true : false
323            });
324            mixpanel.instance2?.register({
325                'user_type': userType,
326                'isInProTrial': isProTrial ? true : false
327            });
328            var sessionTracking = getInitialMixpanelSessionData(name);
329            mixpanel.register({sessionNumber: sessionTracking.sessionNumber});
330            mixpanel.instance2?.register({sessionNumber: sessionTracking.sessionNumber});
331            mixpanel.people.set({$email: name, $name: name, uuid: uuid, user_t
331ype: userType, 'isInProTrial': isProTrial ? true : false});
332            mixpanel.instance2?.people?.set({$email: name, $name: name, uuid: uuid, user_type: userType, 'isInProTrial': isProTrial ? true : false});
333
334
335            if (moreProperties) {
336                mixpanel.register(moreProperties);
337                mixpanel.instance2?.register(moreProperties);
338                mixpanel.people.set(moreProperties);
339                mixpanel.instance2?.people?.set(moreProperties);
340                if (moreProperties.accountCreationDate) {
341                    mixpanel.people.set({$created: moreProperties.accountCreationDate});
342                    mixpanel.instance2?.people?.set({$created: moreProperties.accountCreationDate});
343                }
344            }
345
346            // track device unique id
347            var deviceId = localStorage.d_deviceId;
348            if (!deviceId) {
349                deviceId = uuidv4();
350                localStorage.d_deviceId = deviceId;
351            }
352            mixpanel.register({
353                'deviceId': deviceId
354            });
355            mixpanel.instance2?.register({
356                'deviceId': deviceId
357            });
358            return true;
359        } catch (e) {
360            return false;
361        }
362    };
363
364
365
366
367    function optimizelyTrackEvent(eventName) {
368        if (typeof (isReseller) != 'undefined' && isReseller && eventName.search(/site/i) > 0) {
369            eventName = eventName.replace("site", "_reseller_site");
370            eventName = eventName.replace("Site", "_reseller_Site");
371        }
372        window.optimizely = window.optimizely || [];
373        window.optimizely.push(['trackEvent', eventName]);
374    }
375
376    function optimizelyTrackRevenue(revenue) {
377        window.optimizely = window.optimizely || [];
378        window.optimizely.push(['trackEvent', 'revenue', {
379            "revenue": revenue * 100
380        }]);
381    }
382
383    function totangoTrackEvent(eventName, moduleName) {
384        if (typeof (isReseller) != 'undefined' && isReseller && typeof (totango) != 'undefined') {
385            totango.track(eventName, moduleName);
386        }
387    }
388
389    function _clientTrackEvent(eventName, eventData) {
390        if (!window["dmTrack"])
391            return;
392        dmTrack.trackEvent(eventName, eventData);
393    }
394
395    function _clientTrackIdentifyFromCookie() {
396        if (!window["dmTrack"])
397            return;
398        var idCookieContent = $.cookie("_dm_account");
399        if (idCookieContent) {
400            try {
401                var idObj = JSON.parse(idCookieContent) || {};
402                if (idObj.uuid) {
403                    dmTrack.identify(idObj.uuid);
404                }
405            } catch (e) {
406            }
407        }
408    }
409
410    function getInitialMixpanelSessionData() {
411        var sessionInterval = parseInt((window.commonProps && window.commonProps['mixpanel.session.tracking.interval']) || 30 * 60 * 1000, 10);
412        var currentTime = Date.now();
413        var id = window.dm_account_name || (window.hallDashboardData || {account: {}}).account.name || 'defaultAccount';
414        var sessionData = JSON.parse(window.localStorage.getItem('builderSessionData')) || {
415            [id]: {
416                sessionNumber: 1,
417                lastEvent: Date.now(),
418                lastInitial: currentTime
419            }
420        };
421        if (!sessionData[id]) {
422            sessionData[id] = {sessionNumber: 1, lastEvent: currentTime, lastInitial: currentTime};
423        }
424
425        if (currentTime - sessionData[id].lastInitial > sessionInterval) {
426            sessionData[id].sessionNumber = sessionData[id].sessionNumber + 1;
427            sessionData[id].lastInitial = currentTime;
428            sessionData[id].lastEvent = currentTime;
429        }
430
431        localStorage.setItem('builderSessionData', JSON.stringify(sessionData));
432        var userData = sessionData[id];
433        return userData;
434    }
435
436    
437
438
439function goToCrossDomainLink(url) {
440	ga('linker:decorate', url);
441	return false;
442}
443
444function dmReadCookie(name) {
445	var nameEQ = name + "=";
446	var ca = document.cookie.split(';');
447	for(var i=0; i < ca.length; i++) {
448		var c = ca[i];
449		while (c.charAt(0) == ' ')
450			c = c.substring(1, c.length);
451			if (c.indexOf(nameEQ) == 0)
452				return c.substring(nameEQ.length,c.length);
453	}
454	return null;
455}
456
457function dmTrackEvent(event, param, value, additionalParams) {
458	try {
459	updateMixPanelSession(event, param, value, additionalParams);
460
461		var i = 0, v = "";
462		if (param == undefined) {
463			dataLayer.push({
464				'event' : event
465			});
466			mixpanel.track(event);
467			mixpanel.instance2?.track(event);
468		} else {
469			var params = {};
470			params[param] = value;
471			if (additionalParams) {
472				var params = $.extend(params, additionalParams);
473			}
474			var dmAccount = dmReadCookie('_dm_account');
475			if (dmAccount && dmAccount.gaType)
476				ga('set', GAU_DIM_UTYPE, dmAccount.gaType);
477
478			var dataLayerParams = $.extend({
479				'event' : event
480			}, params);
481			dataLayer.push(dataLayerParams);
482			mixpanel.track(event, params);
483			mixpanel.instance2?.track(event, params);
484			_clientTrackEvent(event, params);
485		}
486		if (event == "d1-site-created") {
487			optimizelyTrackEvent("D1SiteCreated");
488			optimizelyTrackEvent("AllSiteCreated");
489			_clientTrackEvent(event, params);
490		} else if (event == "d1-publish") {
491			optimizelyTrackEvent("D1SitePublished");
492			optimizelyTrackEvent("AllSitePublished");
493			_clientTrackEvent(event, params);
494		} else if (event == WR_SITE_PUBLISHED) {
495			optimizelyTrackEvent("sitePublished");
496			optimizelyTrackEvent("AllSitePublished");
497			_clientTrackEvent(event, params);
498
499		} else if (event == SITE_CREATE_ACCOUNT) {
500			optimizelyTrackEvent("new_registered_users");
501			_clientTrackEvent(event, params);
502		} else if (event == WR_NEW_USER_SITE_CREATED || event == WR_EXISTING_USER_SITE_CREATED) {
503			optimizelyTrackEvent("siteCreated");
504			optimizelyTrackEvent("AllSiteCreated");
505			_clientTrackEvent(event, params);
506
507		} else if (event == PT_NEW_USER_SITE_CREATED) {
508			if (_trackCreatedViaIframe) {
509				// include an iframe that will set the tracking pixels correctly
510				$(
511						'<iframe id="siteCreatedTrackFrame" style="width:0px;height:0px" name="siteCreatedTrackFrame" src="/common/scripts/dm.track-site-created.jsp">')
512						.appendTo('body');
513			}
514		}
515
516		if (event == WR_NEW_USER_SITE_CREATED || event == WR_EXISTING_USER_SITE_CREATED
517				|| event == PT_NEW_USER_SITE_CREATED || event == PT_EXISTING_USER_SITE_CREATED) {
518			dmTrackEvent(PT_SITE_CREATED, params, value, aditionalParams);
519		}
520
521		return true;
522	} catch (e) {
523		return false;
524	}
525};
526
527function dmTrackEcommerce(trans, item) {
528	ga('send', 'pageview');
529
530	ga('ecommerce:addTransaction', {
531		'id' : trans.orderId,
532		'revenue' : trans.total,
533		'shipping' : '0',
534		'tax' : '0'
535	});
536
537	ga('ecommerce:addItem', {
538		'id' : trans.orderId,
539		'name' : item.product,
540		'sku' : item.contract,
541		'price' : item.total,
542		'quantity' : item.quantity
543	});
544}
545
546function updateMixPanelSession(event, param, value, additionalParams) {
547	try {
548		var sessionInterval = parseInt(
549				(window.commonProps && window.commonProps['mixpanel.session.tracking.interval'])
550				|| 30 * 60 * 1000, 10);
551		var id = window.dm_account_name || (window.hallDashboardData
552				|| { account: {} }).account.name || 'defaultAccount';
553		var sessionData = JSON.parse(window.localStorage.getItem('builderSessionData'));
554		if (!sessionData) {
555			return;
556		}
557
558		if (!sessionData[id]) {
559			return;
560		}
561		var currentTime = Date.now();
562		var userData = sessionData[id] || {};
563		if (currentTime - sessionData[id].lastEvent > sessionInterval) {
564			sessionData[id].sessionNumber = sessionData[id].sessionNumber + 1;
565			window.mixpanel.register({ sessionNumber: sessionData[id].sessionNumber });
566			window.mixpanel.instance2?.register({ sessionNumber: sessionData[id].sessionNumber });
567		}
568		sessionData[id].lastEvent = currentTime;
569		window.localStorage.setItem('builderSessionData', JSON.stringify(sessionData));
570	} catch (e){};
571}
572

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.