PageSourceSearch

https://dmexco.com/wp-content/themes/deploy/assets/js/custom-tracking-events.js?ver=1.1

js dmexco.com collected 2026-10-01 08:36:13 UTC 7,257 bytes, 205 lines download raw bytes

1$(document).ready(function(){
2
3  //console.log("custom events yo yo!");
4
5  // --------- social share ----------
6  $(document).on('click','.socials__item, .goe-share-buttons a',function(){
7    if(!$(this).parent().hasClass('footer__socials')){
8      var custom_event = {
9        'event' : 'social_share'
10      }
11      var link = $(this).attr('href');
12      if(link.indexOf("https://www.facebook.com") !== -1){
13        custom_event['network'] = "Facebook";
14      }
15      else if(link.indexOf("https://twitter.com") !== -1){
16        custom_event['network'] = "Twitter";
17      }
18      else if(link.indexOf("https://www.linkedin.com") !== -1){
19        custom_event['network'] = "Linkedin";
20      }
21      else if(link.indexOf("https://www.xing.com") !== -1){
22        custom_event['network'] = "Xing";
23      }
24      else{
25        custom_event['network'] = "Mail";
26      }
27
28      if ($(this).parent().hasClass('plyr-share')){
29        if ($('body').hasClass('page-template-page-homepage')){
30          custom_event['share_object'] = 'video-livestream';
31        }
32        else{
33          custom_event['share_object'] = 'video-in-article';
34        }
35      }
36      else if ($('body').hasClass('single-stories')){
37        custom_event['share_object'] = 'story';
38      }
39      else if($('body').hasClass('single-podcasts')){
40        custom_event['share_object'] = 'podcast';
41      }
42      else if($('body').hasClass('single-events')){
43        custom_event['share_object'] = 'event';
44      }
45      else if($('body').hasClass('single-press')){
46        custom_event['share_object'] = 'press';
47      }
48      else if($('body').hasClass('page-template-page-videos')){
49        custom_event['share_object'] = 'video-channel';
50      }
51      else{
52        custom_event['share_object'] = 'page';
53      }
54
55      if (custom_event.share_object === 'video-channel'){
56        custom_event['share_object_details'] = $('.goeEditableTitle-title').text();
57      }
58      else{
59        custom_event['share_object_details'] = location.pathname.substring(1);
60      }
61      dataLayer.push(custom_event);
62      console.log(custom_event);
63    }
64  })
65
66  // --------- podcast_click ----------
67  // this part is coded in 'scripts-ms.js' inside `init_podcast_players()` function
68  // ----------------------------------
69
70  // --------- podcast_subscribtion ----------
71  $(document).on('click','.single-podcasts .plyr__subscribebox .socials__link',function(){
72    var custom_event = {
73      'event' : 'podcast_subscribtion',
74      'podcast_name' : $('.podcast-title').text().trim(),
75      'podcast_track' : $('.podcast-track').text(),
76    }
77    var link = $(this).attr('href');
78    if (link.indexOf('https://itunes.apple.com') != -1){
79      custom_event['podcast_channel'] = 'iTunes';
80    }
81    else if (link.indexOf('https://open.spotify.com') != -1){
82      custom_event['podcast_channel'] = 'Spotify';
83    }
84    else{
85      custom_event['podcast_channel'] = 'Deezer';
86    }
87
88    dataLayer.push(custom_event);
89    console.log(custom_event);
90  });
91
92  $(document).on('click','.single-podcasts .plyr__subscribebox .plyr-share-input',function(){
93    var custom_event = {
94      'event' : 'podcast_subscribtion',
95      'podcast_name' : $('.podcast-title').text().trim(),
96      'podcast_track' : $('.podcast-track').text(),
97      'podcast_channel' : 'RSS'
98    }
99    dataLayer.push(custom_event);
100    console.log(custom_event);
101  });
102
103  // --------- newsletter_requested ----------
104
105  // moved to formSubmited event
106
107  /*$(document).on('click','#hb-newsletter .hs-submit input',function(){
108    if(($('.hs-email input').val() != "") && ($('.legal-consent-container input').prop('checked'))){
109      const custom_event = {
110        'event' : 'newsletter_requested',
111        'location' : 'footer'
112      }
113      if ($('.hs_contact_type_en_dropdown select').val()){
114        custom_event['participation'] = $('.hs_contact_type_en_dropdown select').val();
115      }
116      dataLayer.push(custom_event);
117      console.log(custom_event);
118    }
119  });*/
120
121  /*$(document).on('click','#hb-exhibitor .hs-submit input',function(){
122    if(($('.hs-email input').val() != "") && ($('.legal-consent-container input').prop('checked'))){
123      var tracks = [];
124      $('.hs_stories_notification_preferences input:checked').each(function(){
125        tracks.push($(this).val());
126      })
127      tracks = tracks.join(", ");
128      const custom_event = {
129        'event' : 'newsletter_requested',
130        'location' : 'newsletter-lp',
131      }
132      if(tracks){
133        custom_event['track'] = tracks;
134      }
135      if($('.hs_contact_type_radioselect_nl_input_only input:checked').val()){
136        custom_event['participation'] = $('.hs_contact_type_radioselect_nl_input_only input:checked').val();
137      }
138      dataLayer.push(custom_event);
139      console.log(custom_event);
140    }
141  });*/
142  $(document).on('change','.hs_contact_type_en_dropdown select',function(){
143    newsletter_participation = $(this).val();
144  });
145  $(document).on('change','.hs_stories_notification_preferences input',function(){
146    tracks = [];
147    $('.hs_stories_notification_preferences input:checked').each(function(){
148      tracks.push($(this).val());
149    });
150    tracks = tracks.join(", ");
151    //console.log(tracks);
152  });
153  $(document).on('change','.hs_contact_type_radioselect_nl_input_only input',function(){
154    newsletter_participation = $('.hs_contact_type_radioselect_nl_input_only input:checked').val();
155    //console.log(newsletter_participation);
156  });
157
158  // --------- tickets CTA click ----------
159  $(document).on('click','#nav-main .tickets-btn',function(){
160    custom_event = {
161      'event': 'tickets_click',
162      'location': 'top_bar'
163    }
164    dataLayer.push(custom_event);
165    console.log(custom_event);
166  });
167
168  // --------- tickets choice ----------
169  $(document).on('click','.page-template-page-tickets_lp .buy-ticket',function(){
170    var text = $(this).text().toLowerCase();
171    //console.log(text);
172    custom_event = {
173      'event': 'tickets_choice',
174    }
175    if ((text.indexOf('buy') !== -1) || (text.indexOf('kaufen') !== -1)){
176      custom_event['ticket_choice'] = 'Buy ticket for...';
177    }
178    else if((text.indexOf('apply') !== -1) || (text.indexOf('bewerben') !== -1)){
179      custom_event['ticket_choice'] = 'Apply now';
180    }
181    else if((text.indexOf('voucher') !== -1) || (text.indexOf('gutschein') !== -1)){
182      custom_event['ticket_choice'] = 'Redeem voucher';
183    }
184    else if(text.indexOf('shop') !== -1){
185      custom_event['ticket_choice'] = 'Go to Shop Homepage';
186    }
187
188    if ((custom_event.ticket_choice === 'Buy ticket for...') || custom_event.ticket_choice === 'Apply now'){
189      custom_event['ticket_name_price'] = $(this).parents('.post').find('.ticket-name').text().trim();
190    }
191    dataLayer.push(custom_event);
192    console.log(custom_event);
193  });
194
195  // custom CTAs events
196  $(document).on('click','.guide_click--tracking',function(){
197    custom_event = {
198      'event': 'guide_click',
199      'page_path': location.pathname
200    }
201    dataLayer.push(custom_event);
202    console.log(custom_event);
203  });
204
205});

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.