PageSourceSearch

https://www.sunlifegrepa.com/wp-content/themes/sunlife/js/sitetracking.js

js sunlifegrepa.com collected 2026-10-04 08:11:39 UTC 29,570 bytes, 967 lines download raw bytes

1// V 0.2 - as of 10 Nov
2// added change for sign-in and forms
3// Global variable
4var asiaSite;
5
6$(document).ready(function() {
7    var site;
8    //var hostname = $(location).attr('hostname');
9    var pathname = $(location).attr('pathname').toLowerCase();
10
11    if (pathname.indexOf('/ph') > -1) {
12        site = "ph";
13    }
14    if (pathname.indexOf('/hk') > -1) {
15        site = "hk";
16    }
17    if (pathname.indexOf('/id') > -1) {
18        site = "id";
19    }
20
21    //below function's are common for all 3 sites
22    //carousel(); 
23    slflogo();
24    homeLink();
25    searchExpandCollapseEventHandlers();
26    //searchExpansion(); // replaced with searchExpandCollapseEventHandlers()
27    //searchClose(); // replaced with searchExpandCollapseEventHandlers()
28    //searchExpansionmobile(); // replaced with searchExpandCollapseEventHandlers()
29    langPannel();
30    //langPanelMobile();
31    langPanelClose();
32    pinbarExpand();
33    mobileSignin();
34    home();
35    productCard();
36    becomeAnAdvisor();
37
38    // Home page only 
39    if (typeof(pathname) != "undefined") {
40        var paths = pathname.split("/");
41
42        if (paths.length == 2 && site !== 'undefined' && paths[1] == site) {
43            carouselCycle();
44            carouselBannerClick();
45        }
46    }
47
48    // Site specific 
49    if (site !== 'undefined') {
50        asiaSite = site;
51
52        //ph specific
53        if (site === "ph") {
54            homepageSigninSubmit();
55            pinbarSigninSubmit();
56            mobileSiginSubmit();
57            //leadgenformHK();
58            contactUsPH();
59            faqSearchBarPH();
60        }
61
62        //hk specific
63        if (site === "hk") {
64
65            homepageSignHK();
66            pinbarSigninSubmitHK();
67            mobileSiginSubmitHK();
68            contactOrleadgenformHK();
69            //contactUsHK();
70        }
71
72        //id specific
73        if (site === "id") {
74            homepageSignID();
75            pinbarSigninSubmitID();
76            mobileSiginSubmitID();
77            customerSupportSubmitID();
78            leadgenformID();
79
80        }
81
82    }
83
84});
85
86
87// function to track logo click
88function slflogo() {
89    $(document).on("click", ".sunlife-logo, .mobile-logo", function() {
90        if (typeof utag !== 'undefined') {
91            utag.link({
92                ev_type: "other",
93                ev_action: "clk",
94                ev_title: "sun life logo"
95            });
96        }
97    });
98}
99
100// function to track home link click
101function homeLink() {
102    $(document).on("click", ".main-nav li:first a", function() {
103        if (typeof utag !== 'undefined') {
104            utag.link({
105                ev_type: "other",
106                ev_action: "clk",
107                ev_title: "global-nav-home"
108            });
109
110        }
111    });
112}
113
114// Track search expansion by event handler which will also track when search closes upon clicking off the page
115function searchExpandCollapseEventHandlers() {
116    // Expand
117    $('.topCollapse.sun-search').on('show.bs.collapse', function() {
118        if (typeof utag !== 'undefined') {
119            utag.link({
120                ev_type: "other",
121                ev_action: "onpage_impr",
122                ev_title: "search module expansion"
123            });
124
125        }
126    });
127
128    // collapse
129    $('.topCollapse.sun-search').on('hide.bs.collapse', function() {
130        if (typeof utag !== 'undefined') {
131            utag.link({
132                ev_type: "other",
133                ev_action: "onpage_impr",
134                ev_title: "search module close"
135            });
136        }
137    });
138}
139
140// function to track search expansion 
141function searchExpansion() {
142
143    $('.desktop-search-icon').click(function() {
144        // Log search expansion/collapse
145        logSearchExpansion($(this));
146    });
147}
148
149
150// function to track search expansion for mobile
151function searchExpansionmobile() {
152
153    $('.mobile-search-icon').click(function() {
154        // Get Search container that expands/collapses
155        var searchContainer = $('.mobile-search-icon').parents(".mobile-navbar").find("#sun-search");
156
157        // Log search expansion/collapse
158        logSearchExpansion(searchContainer);
159    });
160
161}
162
163// Log tracked search expansion
164function logSearchExpansion(searchContainer) {
165
166    // Get the current state of the search section if it's expanded/collapsed
167    var collapsed = searchContainer.attr('aria-expanded');
168
169    if (collapsed == "false" || typeof(collapsed) == "undefined") { //Going to be Expanded
170        if (typeof utag !== 'undefined') {
171            utag.link({
172                ev_type: "other",
173                ev_action: "onpage_impr",
174                ev_title: "search module expansion"
175            });
176        }
177
178    } else if (collapsed == "true") { //Going to be Collapsed			
179        if (typeof utag !== 'undefined') {
180            utag.link({
181                ev_type: "other",
182                ev_action: "onpage_impr",
183                ev_title: "search module close"
184            });
185        }
186    }
187}
188
189//function to track search close event
190function searchClose() {
191    $("#sun-search").find("div.close-search").find("span.collapse-x").click(function() {
192        if (typeof utag !== 'undefined') {
193            utag.link({
194                ev_type: "other",
195                ev_action: "onpage_impr",
196                ev_title: "search module close"
197            });
198        }
199    });
200}
201
202//function to track pinabr sign-in widget expanding
203function pinbarExpand() {
204    $('#pinbar-signin').click(function() {
205        if ($(this).attr('aria-expanded') == "false") {
206
207            // Log clicked pinbar and signin module expanding
208            if (typeof utag !== 'undefined') {
209                utag.link({
210                    ev_type: "other",
211                    ev_action: "onpage_impr",
212                    ev_title: "expand signin - pinbar"
213                });
214            }
215
216        }
217    });
218}
219
220
221//function to track language panel expansion event in desktop  
222function langPannel() {
223
224    $('#language-btn').click(function() {
225        // Get the current state of the search section if it's expanded/collapsed
226        var collapsed = $(this).attr('aria-expanded');
227
228        if (collapsed == "false" || typeof(collapsed) == "undefined") { //Going to be Expanded
229            if (typeof utag !== 'undefined') {
230                utag.link({
231                    ev_type: "other",
232                    ev_action: "onpage_impr",
233                    ev_title: "language panel expansion"
234                });
235            }
236
237        } else if (collapsed == "true") { //Going to be Collapsed			
238            if (typeof utag !== 'undefined') {
239                utag.link({
240                    ev_type: "other",
241                    ev_action: "onpage_impr",
242                    ev_title: "language panel close"
243                });
244            }
245        }
246    });
247}
248
249//function to track language panel expansion event in mobile
250function langPanelMobile() {
251
252    $('li.mar-top-20').find('a.dropdown-toggle').click(function() {
253        // Get the current state of the search section if it's expanded/collapsed
254        var collapsed = $(this).parent("li").hasClass("open");
255
256        if (collapsed === false) { //Going to be Expanded
257            if (typeof utag !== 'undefined') {
258                utag.link({
259                    ev_type: "other",
260                    ev_action: "onpage_impr",
261                    ev_title: "language panel expansion"
262                });
263            }
264
265        } else if (collapsed === true) { //Going to be Collapsed			
266            if (typeof utag !== 'undefined') {
267                utag.link({
268                    ev_type: "other",
269                    ev_action: "onpage_impr",
270                    ev_title: "language panel close"
271                });
272            }
273        }
274    });
275}
276
277//function to close langpanel in desktop
278function langPanelClose() {
279
280    $("#sun-language").find("span.collapse-x").click(function() {
281        // Closing language panel has been tracked
282        if (typeof utag !== 'undefined') {
283            utag.link({
284                ev_type: "other",
285                ev_action: "onpage_impr",
286                ev_title: "language panel close"
287            });
288
289        }
290    });
291}
292
293// function mobile siginin
294function mobileSignin() {
295
296    $("#customer-sign-sm").click(function() {
297
298        // Mobile signin event has been tracked
299        if (typeof utag !== 'undefined') {
300            utag.link({
301                ev_type: "other",
302                ev_action: "onpage_impr",
303                ev_title: "expand sign in - mobile"
304            });
305        }
306    });
307}
308
309// Home Page Signin Submit
310function homepageSigninSubmit() {
311
312    $("#form_signon").find("#passwordDiv").find("input.btn").click(function() {
313        // Log that the signing button is clicked
314        homepageSigninGeneralLog("");
315    });
316}
317
318// Track Signin Button - Indonesia site
319function homepageSignID() {
320
321    $("#signIn").find("input.btn").click(function() {
322
323        // Get option selected
324        var option = $(".dropdownMargnrght").find("option:selected").text();
325
326        // log web tracking 
327        homepageSigninGeneralLog(option);
328    });
329}
330
331//function for tracking mobile version signin submit event for HK
332function homepageSignHK() {
333	$("#passwordDiv").find("a").click(function() {
334		// Get option clicked
335		var option = $(this).text();
336		
337		// Log web tracking 
338		homepageSigninGeneralLog(option);
339	});
340}
341
342// Log web tracking for home page signin
343function homepageSigninGeneralLog(ev_data_one) {
344    if (typeof utag !== 'undefined') {
345        utag.link({
346            ev_type: "authenticate",
347            ev_action: "signin",
348            ev_title: "signin link - main",
349            ev_data_one: ev_data_one
350        });
351    }
352}
353
354//function for tracking pinbar signin button click event for PH
355function pinbarSigninSubmit() {
356
357    $("#footer-pin-bar #form_signon_pinbar #passwordDiv_pinbar").find("input.btn").click(function() {
358
359        // Pinbar signin submit traked succesfully
360        pinbarSigninSubmitGeneralLog("");
361    });
362}
363
364//function for tracking pinbar signin button click event for ID
365function pinbarSigninSubmitID() {
366
367    $("#signin-widget-pinbar p").find("a").each(function() {
368
369        $(this).click(function() {
370            // Get selecte signin option
371            var option = $(this).text();
372
373            // Pinbar signin submit traked succesfully
374            pinbarSigninSubmitGeneralLog(option);
375        });
376
377    });
378}
379
380//function for tracking pinbar signin button click event for HK
381function pinbarSigninSubmitHK() {
382
383    $("#signin-widget-pinbar p").find("a").click(function() {
384        // Get select signin option
385        var option = $(this).text();
386
387        // Pinbar signin submit traked succesfully
388        pinbarSigninSubmitGeneralLog(option);
389    });
390}
391
392// Log web tracking for pinbar signin
393function pinbarSigninSubmitGeneralLog(ev_data_one) {
394    if (typeof utag !== 'undefined') {
395        utag.link({
396            ev_type: "authenticate",
397            ev_action: "signin",
398            ev_title: "signin link - pinbar",
399            ev_data_one: ev_data_one
400        });
401    }
402}
403
404//function for tracking mobile version signin submit event for PH
405function mobileSiginSubmit() {
406
407    $("#customerSignInMobile #signin-widget-mobile #form_signon_mobile #passwordDiv").find("input.btn").click(function() {
408        // Track signin click 
409        mobileSiginSubmitGeneralLog("");
410    });
411}
412
413//function for tracking mobile version signin submit event for ID
414function mobileSiginSubmitID() {
415
416    $(".mobile-login-form .text-center").find("a").each(function() {
417
418        $(this).click(function() {
419            // Get clicked signin option
420            var option = $(this).text();
421
422            // Track signin
423            mobileSiginSubmitGeneralLog(option);
424        });
425    });
426}
427
428//function for tracking mobile version signin submit event for HK
429function mobileSiginSubmitHK() {
430    $(".mobile-login-form .text-center").find("a").click(function() {
431        // Get clicked signin option
432        var option = $(this).text();
433
434        // Track signin option selected 
435        mobileSiginSubmitGeneralLog(option);
436    });
437}
438
439function mobileSiginSubmitGeneralLog(ev_data_one) {
440    // Mobile signin button click tracked .. mobileSiginSubmit
441    if (typeof utag !== 'undefined') {
442        utag.link({
443            ev_type: "authenticate",
444            ev_action: "signin",
445            ev_title: "signin link - mobile modal",
446            ev_data_one: ev_data_one
447        });
448    }
449}
450
451//This function is to track ID customer support page submit button click and page error
452function customerSupportSubmitID() {
453
454    $("#Contactus #advisor-modal-submit-btn").click(function() {
455        var statusmessage = "";
456        var count = 0;
457
458        // Determine if Customer Support or Contact Us page
459        var ulrStr = "client+service+center";
460        var ev_title = "customer-support-form";
461
462        if (typeof(utag_data) != "undefined") {
463            var clientService = utag_data.canonical_url.toLowerCase().indexOf(ulrStr)
464
465            // Contact us page
466            if (clientService < 0) {
467                ev_title = "contact-us-form"
468            }
469        }
470
471        // Log tracking when submit button is clicked
472        if ($(".parsley-errors-list").hasClass("filled")) {
473
474            // Record error messages after clicking submit button
475            statusmessage = parsleyToDataTrackingError();
476
477            // Submit clicked tracked with error
478            if (typeof utag !== 'undefined') {
479                utag.link({
480                    ev_type: "other",
481                    ev_action: "clk",
482                    ev_title: ev_title,
483                    ev_data_one: statusmessage
484                });
485            }
486        } else {
487            // Submit successful submit tracking
488            if (typeof utag !== 'undefined') {
489                utag.link({
490                    ev_type: "other",
491                    ev_action: "clk",
492                    ev_title: ev_title,
493                    ev_data_one: "successful submission"
494                });
495            }
496        }
497    });
498}
499
500
501
502//This function is to track ID Lead gen page submit button click and page error
503function leadgenformID() {
504    $("#leadgen #advisor-modal-submit-btn").click(function() {
505        var statusmessage = "";
506        var count = 0;
507
508        if ($(".parsley-errors-list").hasClass("filled")) {
509
510            // Grab the errors on the page
511            statusmessage = parsleyToDataTrackingError();
512
513            // Submit clicked tracked with error
514            if (typeof utag !== 'undefined') {
515                utag.link({
516                    ev_type: "lead_form",
517                    ev_action: "submit",
518                    ev_title: "talk-to-an-advisor-lead-gen-form",
519                    ev_data_one: statusmessage
520                });
521
522            }
523
524        } else {
525
526            // Submit clicked tracked with no error
527            if (typeof utag !== 'undefined') {
528                utag.link({
529                    ev_type: "lead_form",
530                    ev_action: "submit",
531                    ev_title: "talk-to-an-advisor-lead-gen-form",
532                    ev_data_one: "successful submission"
533                });
534
535            }
536        }
537
538    });
539}
540
541//This function is to track HK Lead gen page submit button click and page error
542function contactOrleadgenformHK() {
543
544    $("#advisor-modal-form #advisor-modal-submit-btnContact").click(function() {
545        var statusmessage;
546        var count = 0;
547
548        // Determine if Contact Us or Lead Gen 
549        var ulrStr = "contact+us";
550        var ev_type = "other";
551        var ev_title = "contact-us-form";
552        var ev_action = "clk";
553        var ev_data_two = $("#enquiry_name").find(':selected').attr('data-id');
554		var contactus="";
555		
556        if (typeof(utag_data) != "undefined") {
557            contactus = utag_data.canonical_url.toLowerCase().indexOf(ulrStr)
558
559            // lead gen form 
560            if (contactus < 0) {
561                ev_type = "lead_form";
562                ev_title = "talk-to-an-advisor-lead-gen-form";
563                ev_action = "submit";
564            }
565        }
566
567        if ($(".parsley-errors-list").hasClass("filled")) {
568
569            // Grab the errors on the page
570            statusmessage = parsleyToDataTrackingError();
571
572            // Submit clicked tracked with error
573            if (typeof utag !== 'undefined') {
574                utag.link({
575                    ev_type: ev_type,
576                    ev_action: ev_action,
577                    ev_title: ev_title,
578                    ev_data_one: statusmessage
579					
580                });
581            }
582
583        } else {
584
585            // Submit clicked tracked with no error
586            if (typeof utag !== 'undefined') {
587                if (contactus < 0) {
588                    utag.link({
589                        ev_type: ev_type,
590                        ev_action: ev_action,
591                        ev_title: ev_title,
592                        ev_data_one: "successful submission"
593                    });
594
595                } else {
596                    utag.link({
597                        ev_type: ev_type,
598                        ev_action: ev_action,
599                        ev_title: ev_title,
600                        ev_data_one: "successful submission",
601                        ev_data_two: ev_data_two
602                    });
603
604                }
605            }
606        }
607
608    });
609
610
611
612
613    $("#advisor-modal-form-mobile #advisor-modal-submit-btnContact-mobile").click(function() {
614        var statusmessage;
615        var count = 0;
616
617        // Determine if Contact Us or Lead Gen 
618        var ulrStr = "contact+us";
619        var ev_type = "other";
620        var ev_title = "contact-us-form";
621        var ev_action = "clk";
622
623
624        if (typeof(utag_data) != "undefined") {
625            var contactus = utag_data.canonical_url.toLowerCase().indexOf(ulrStr)
626
627            // lead gen form 
628            if (contactus < 0) {
629                ev_type = "lead_form";
630                ev_title = "talk-to-an-advisor-lead-gen-form";
631                ev_action = "submit";
632            }
633        }
634
635        if ($(".parsley-errors-list").hasClass("filled")) {
636
637            // Grab the errors on the page
638            statusmessage = parsleyToDataTrackingError();
639
640            // Submit clicked tracked with error
641            if (typeof utag !== 'undefined') {
642                utag.link({
643                    ev_type: ev_type,
644                    ev_action: ev_action,
645                    ev_title: ev_title,
646                    ev_data_one: statusmessage
647                });
648            }
649
650        } else {
651
652            // Submit clicked tracked with no error
653            if (typeof utag !== 'undefined') {
654                utag.link({
655                    ev_type: ev_type,
656                    ev_action: ev_action,
657                    ev_title: ev_title,
658                    ev_data_one: "successful submission"
659                });
660
661            }
662        }
663
664    });
665
666
667}
668
669
670function contactUsPH() {
671
672    $("#advisor-modal-form #advisor-modal-submit-btn").click(function() {
673        var statusmessage;
674        var count = 0;
675
676        // Determine if Contact Us or Lead Gen 
677        var urlStr = "contact+us";
678        var ev_type = "other";
679        var ev_title = "contact-us-form";
680        var ev_action = "clk";
681
682
683        if (typeof(utag_data) != "undefined") {
684            var utagCanonicalURL = utag_data.canonical_url.toLowerCase();
685            var contactus = utagCanonicalURL.indexOf(urlStr);
686
687            // lead gen form 
688            if (contactus < 0) {
689                // Grab the last parameter in the canonical url
690                var lastParam = utagCanonicalURL.split("/");
691                lastParam = (lastParam[lastParam.length - 1]).split("?");
692                lastParam = (lastParam[0]).replace(/\+/g, "-");
693
694                // Set the title 
695                if (lastParam && lastParam.indexOf("form") < 0 && lastParam.indexOf("advisor") >= 0) {
696                    ev_title = lastParam + "-lead-gen-form";
697                } else if (lastParam && lastParam.indexOf("form") < 0) {
698                    ev_title = lastParam + "-form";
699                } else if (lastParam) {
700                    ev_title = lastParam;
701                }
702
703                // Update the type to lead gen 
704                if (lastParam.indexOf("advisor") >= 0) {
705                    ev_type = "lead_form";
706                    ev_action = "submit";
707                }
708            }
709        }
710
711        if ($(".parsley-errors-list").hasClass("filled")) {
712
713            // Submit clicked tracked with error"
714            statusmessage = parsleyToDataTrackingError();
715
716            if (typeof utag !== 'undefined') {
717                utag.link({
718                    ev_type: ev_type,
719                    ev_action: ev_action,
720                    ev_title: ev_title,
721                    ev_data_one: statusmessage
722                });
723            }
724        } else {
725
726            // Submit clicked tracked with no error");
727            if (typeof utag !== 'undefined') {
728                utag.link({
729                    ev_type: ev_type,
730                    ev_action: ev_action,
731                    ev_title: ev_title,
732                    ev_data_one: "successful submission"
733                });
734
735            }
736
737        }
738
739    });
740}
741
742
743function parsleyToDataTrackingError() {
744    var count = 0;
745    var statusmessage = "";
746
747    // Submit clicked tracked with error
748    $(".parsley-errors-list.filled").find("li").each(function(index, item) {
749        var errorID = $(item).closest("ul").attr("id").replace("parsley-id-", "");
750        var parsleyClass = $(item).attr("class").split(" ");
751        var errorType = "";
752
753        // Find the error based on the parsley generated class 
754        var parsleyStr = "parsley-";
755        var customParsley = "parsley-custom-error-message";
756        for (var i = 0; i < parsleyClass.length; i++) {
757            var found = parsleyClass[i].indexOf(parsleyStr);
758
759            if (parsleyClass[i] == customParsley) {
760                errorType = "error";
761                break;
762            } else if (found >= 0) {
763                errorType = parsleyClass[i].replace(parsleyStr, "");
764                break;
765            }
766        }
767
768        // Get data tracking error message 
769        var dataTrackingMsg = $("[data-parsley-id='" + errorID + "']").attr("data-tracking-" + errorType + "-message");
770
771        if (typeof(dataTrackingMsg) == "undefined" && count == 0) {
772            statusmessage = "err: " + $(item).text();
773        } else if (typeof(dataTrackingMsg) == "undefined" && count > 0) {
774            statusmessage = statusmessage + "|err: " + $(item).text();
775        } else if (count > 0) {
776            statusmessage = statusmessage + "|err: " + dataTrackingMsg;
777        } else {
778            statusmessage = "err: " + dataTrackingMsg;
779        }
780
781        // Increase error counter
782        count++;
783    });
784
785    return statusmessage;
786}
787
788function home() {
789
790    $(".main-nav").find("li").first().attr("data-section", "global-nav-home");
791
792}
793
794// Track product card clicks
795function productCard() {
796
797    $(document).on("click", ".feature-card, .normal-card", function() {
798
799        var name = $(this).find("h2.Product-Name").text();
800        var pcatgName = $(this).parent().attr("data-section");
801        //console.log("pcatgName>>"+pcatgName);
802        if ('editorial-related-products' !== pcatgName) {
803            if (typeof utag !== 'undefined') {
804                utag.link({
805                    ev_type: "other",
806                    ev_action: "clk",
807                    ev_title: "product-array-lvl3-" + name
808                });
809            }
810        }
811    });
812}
813
814
815// Become an advisor form button tracking
816function becomeAnAdvisor() {
817    var page = $("#pageheading").find("h1").text();
818
819    if (page == "Become a Financial Advisor") {
820
821        $("input.btn").click(function() {
822            var statusmessage = "";
823            var count = 0;
824
825            if ($(".parsley-errors-list").hasClass("filled")) {
826
827                // Submit clicked tracked with error
828                $(".parsley-errors-list.filled").find("li").each(function(index, item) {
829                    if (count > 0) {
830                        statusmessage = statusmessage + " | error: " + $(item).text();
831                    } else {
832                        statusmessage = "error: " + $(item).text();
833                    }
834                    count++;
835                });
836
837                if (typeof utag !== 'undefined') {
838                    utag.link({
839                        ev_type: "lead_form",
840                        ev_action: "submit",
841                        ev_title: "become-an-advisor-lead-gen-form",
842                        ev_data_one: statusmessage
843                    });
844
845                }
846            } else {
847
848                // Submit clicked tracked with no error
849                if (typeof utag !== 'undefined') {
850                    utag.link({
851                        ev_type: "lead_form",
852                        ev_action: "submit",
853                        ev_title: "become-an-advisor-lead-gen-form",
854                        ev_data_one: "successful submission"
855                    });
856                }
857            }
858        });
859    }
860}
861
862function carousel() {
863
864    var count = 0;
865    var i = 0;
866    for (i = 0; count <= 2; i++) {
867
868        if ($("ol.carousel-indicators").find("li").last().hasClass("active")) {
869            count = count + 1;
870        }
871        if (count == 2) {
872            // Completed second cycle");
873        }
874    }
875}
876
877// Track when the carousel slide is displayed to the user 
878function carouselCycle() {
879    var carouselBannerCount = 0; //Count number of slides cycle through
880    var maxCarouselCount = 0; //Max number of cycles
881
882    // Only track for 2 cycles
883    if ($("#myCarousel").length > 0) {
884        maxCarouselCount = $("#myCarousel").find(".carouselBanner").length * 2
885    }
886
887    // Log initial banner display
888    if ($("#myCarousel").length > 0 && typeof utag !== 'undefined') {
889        var title = $("#myCarousel").find(".carouselBanner.active h1").text(); //Get banner title
890        carouselBannerCount++; //Increase slide count
891
892        utag.link({
893            ev_type: "ad",
894            ev_action: "onpage_impr",
895            ev_title: title
896        });
897    }
898
899    // Log banner display upon slide
900    $("#myCarousel").bind('slid.bs.carousel', function(e) {
901        carouselBannerCount++; //Increase slide count
902
903        if (carouselBannerCount <= maxCarouselCount && typeof utag !== 'undefined') {
904            var title = $("#myCarousel").find(".carouselBanner.active h1").text(); //Get Banner title
905            utag.link({
906                ev_type: "ad",
907                ev_action: "onpage_impr",
908                ev_title: title
909            });
910        }
911    });
912}
913
914// Track when carousel banner is clicked
915function carouselBannerClick() {
916    $(document).on("click", ".carouselBanner a", function(e) {
917        if (typeof utag !== 'undefined') {
918            var bannerTitle = $(e.target).closest(".carouselBanner").find("h1").text();
919            var linkTitle = $(e.target).text();
920            utag.link({
921                ev_type: "ad",
922                ev_action: "clk",
923                ev_title: bannerTitle,
924                ev_data_one: linkTitle
925            });
926        }
927    });
928}
929
930function faqSearchBarPH() {
931    $("#searchButton").click(function() {
932        // Get content from search input box
933        var searchTerm = $("#searchBox").val();
934        var searchResult = "no query entered";
935
936        // Query entered
937        if (searchTerm) {
938            searchResult = "no results";
939
940            // Results were found 
941            if ($(".list-filter").find(".highlight").length > 0) {
942                //var searchTermAry = searchTerm.split(/[-[\]{}()*+?.,\\^$|#@%&!:\s]/);
943                var searchTermAry = searchTerm.split(/\W/);
944                var faqContent = $(".list-filter").text().toLowerCase();
945
946                for (var i = 0; i < searchTermAry.length; i++) {
947                    word = (searchTermAry[i]).toLowerCase();
948                    if (word != "" && faqContent.indexOf(word) >= 0) {
949                        searchResult = "results found";
950                        break;
951                    }
952                }
953            }
954        }
955
956        // Log web tracking 
957        if (typeof utag !== 'undefined') {
958            utag.link({
959                ev_type: "other",
960                ev_action: "clk",
961                ev_title: "faq search",
962                ev_data_one: searchTerm,
963                ev_data_two: searchResult
964            });
965        }
966    });
967}

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.