PageSourceSearch

https://gokennebunks.com/wp-content/plugins/smartrack/public/assets/js/sTrackStats.js?ver=7.0.5

js gokennebunks.com collected 2026-09-30 15:52:41 UTC 6,709 bytes, 259 lines download raw bytes

1(function( $ ) {
2	"use strict";
3	
4	var _ST = $.fn.smarTrack = function(){},
5		args = sTrackStatsArgs;
6
7	$.extend(true, _ST, {
8		
9
10
11		/**
12		 * Save click actions
13		 */
14		strack_click_action: function(){
15			$('body').find('.strack_bnr').on('click', function(e){
16				var elm = $(this),
17					scaleX = elm[0].getBoundingClientRect().width / elm.width(),
18					scaleY = elm[0].getBoundingClientRect().height / elm.height(),
19					xPos = e.pageX - elm.offset().left,
20					yPos = e.pageY - elm.offset().top;
21			
22				xPos = xPos / scaleX,
23				yPos = yPos / scaleY;
24				console.log($(this).data('bid'));
25				
26				console.log(xPos+','+yPos);
27				$(this).smarTrack.track_event_data({
28					'event_type': 'click',
29					'position':[xPos, yPos], 
30					'id_1': $(this).data('bid'),
31					'id_2': $(this).data('aid')
32				});
33			});
34		},
35		
36		
37		/**
38		 * WPPAS BANNER LINK CLICKS
39		 *
40		 *
41		 */
42		wppas_strack_click: function(){
43			$('.b_container').on('click', function(e){
44				var elm = $(this),
45					scaleX = elm[0].getBoundingClientRect().width / elm.width(),
46					scaleY = elm[0].getBoundingClientRect().height / elm.height(),
47					xPos = e.pageX - elm.offset().left,
48					yPos = e.pageY - elm.offset().top;
49			
50				xPos = xPos / scaleX,
51				yPos = yPos / scaleY;
52				console.log($(this).data('bid'));
53				
54				console.log(xPos+','+yPos);
55				$(this).smarTrack.track_event_data({
56					'event_type': 'click',
57					'position':[xPos, yPos], 
58					'id_1': $(this).data('bid'),
59					'id_2': $(this).data('zn')
60				});
61			});
62		},
63	 	/*strack_click: function(){
64			$('a').on('click', function(){
65				var pv_id = sTrackStatsArgs.id, //$(this).data('strack_st'),
66					//ev_id = sTrackEvent.id, //$(this).data('strack_ev'),
67					banner_id = $(this).data('bid');
68					//content_id = sTrackStatsArgs.content_id; //$(this).data('strack_pid');
69				
70				if(typeof pv_id != 'undefined'){
71					//console.log(pv_id);
72					$.ajax({
73					   type: "POST",
74					   url: args.ajaxurl,
75					   data: "action=strack_update_click&strack_st="+pv_id+"&banner_id="+banner_id+"&track_id="+args.track_id
76					}).done(function( msg ){
77						console.log('done');
78						console.log(msg);
79					});
80				}
81			});
82		},*/
83		
84		
85		
86		
87		/**
88		 * TRACK PAGE VIEW DATA
89		 *
90		 */
91		track_pview_data: function(data){
92			if( typeof args.id != 'undefined' && args.id != ''){	
93				var ref = encodeURIComponent(document.referrer),
94					screen_w = screen.width,
95					screen_h = screen.height,
96					reso = window.innerWidth+'x'+window.innerHeight
97			
98				//console.log(data['e'][0]+' '+data['e'][1]);
99				$.ajax({
100				   type: "POST",
101				   url: args.ajaxurl,
102				   data: "action=save_pview_data&id="+args.id+"&track_id="+args.track_id+"&ref="+ref+"&screen_w="+screen_w+"&screen_h="+screen_h+"&reso="+reso
103				}).done(function( msg ){
104					console.log('done');
105					console.log(msg);
106				});
107			}
108		},
109		
110		
111		
112		/**
113		 * TRACK EVENT DATA
114		 *
115		 */
116		track_event_data: function(data){
117			
118			if( typeof args.id != 'undefined' && args.id != ''){
119				console.log(args.id);
120				var ids = {
121						'id_1': typeof data['id_1'] != 'undefined' ? data['id_1'] : '',
122						'id_2': typeof data['id_2'] != 'undefined' ? data['id_2'] : '',
123						'id_3': typeof data['id_3'] != 'undefined' ? data['id_3'] : ''
124					},
125					event_type = typeof data['event_type'] != 'undefined' ? data['event_type'] : '',
126					pos = typeof data['position'] != 'undefined' ? JSON.stringify(data['position']) : '';
127				console.log(ids);	
128				console.log(pos);	
129
130				// Set timeout to make sure database row gets created first.
131				setTimeout(function() {
132					$.ajax({
133					type: "POST",
134					url: args.ajaxurl,
135					data: "action=save_event_data&id="+args.id+"&ids="+JSON.stringify(ids)+"&event_type="+event_type+"&track_id="+args.track_id+"&pos="+pos
136					}).done(function( msg ){
137						//console.log('done');
138						console.log(msg);
139					});
140				}, 500);
141			}
142		},
143		
144		
145		
146		
147		/**
148		 * smarTrack Filters
149		 *
150		 */
151		filters: function(){
152			
153			
154			// Load filter options
155			$('#strack_group').on('change', function(){
156				var group = $(this).val();
157					
158				$('#strack_group_id').hide();
159				$('#strack_apply_filter').hide();
160				$('.strack.filters').find('.loading').show();
161				
162				$.ajax({
163				   type: "POST",
164				   url: args.ajaxurl,
165				   data: "action=load_filter_options&group="+group
166				}).done(function( msg ){
167					//console.log('done');
168					//console.log(msg);
169					$('#strack_group_id').show();
170					$('.strack.filters').find('.loading').hide();
171					$('#strack_group_id').html(msg);
172				});
173			});
174			
175			// Select filter option
176			$('#strack_group_id').on('change', function(){
177				var group = $('#strack_group').val(),
178					group_id = $(this).val(),
179					uri = $('#strack_uri').val();
180				
181				$('#strack_apply_filter').hide();
182				$('.strack.filters').find('.loading').show();
183				
184				$.ajax({
185				   type: "POST",
186				   url: args.ajaxurl,
187				   data: "action=select_filter_option&group="+group+"&group_id="+group_id+"&uri="+encodeURIComponent(uri)
188				}).done(function( msg ){
189					//console.log('done');
190					//console.log(msg);
191					
192					$('#strack_apply_filter').show();
193					$('.strack.filters').find('.loading').hide();
194					$('#strack_apply_filter').attr('href', msg);
195				});	
196			});
197		}
198		
199	});
200	
201	
202	console.log(sTrackStatsArgs);
203	
204	if( typeof sTrackStatsArgs != 'undefined' && typeof sTrackStatsArgs.id != 'undefined' && parseInt( sTrackStatsArgs.id ) > 0 ){
205		/*console.log(document);*/
206		/*var all_links = document.getElementsByTagName( "a" );
207		for (var i = 0; i < all_links.length; i++) {
208			console.log(all_links[i].href);
209			console.log(all_links[i].hostname);
210			console.log(location.hostname);
211			console.log(document.referrer);
212		}*/
213
214		// Add delay to make sure all objects are loaded
215		setTimeout(function() {
216			$('.b_container').each(function(i, obj) {
217				//console.log($(this).attr("href"));
218				var _href = $(obj).attr("href");
219				
220				if( typeof _href != 'undefined' ){
221					console.log($(this).attr("href").indexOf('?'));
222					var at = _href.indexOf('?') < 0 ? '?' : '&';
223					$(obj).attr("href", _href + at+'strack='+sTrackStatsArgs.id);
224				}
225			});
226
227			$('body').find('.strack_cli').each(function(i, obj) {
228				var _href = $(obj).attr("href");
229				
230				if( typeof _href != 'undefined' ){
231					console.log($(this).attr("href").indexOf('?'));
232					var at = _href.indexOf('?') < 0 ? '?' : '&';
233					$(obj).attr("href", _href + at+'strack='+sTrackStatsArgs.id);
234				}
235			});
236
237
238			$(this).smarTrack.track_pview_data();
239			$(this).smarTrack.strack_click_action();
240			$(this).smarTrack.wppas_strack_click();
241
242		}, 500);
243		
244
245		
246		
247	}
248	
249	
250	
251	/*jQuery(document).ready(function($){
252		$(this).smarTrack.get_tracking_data();
253	});*/
254	
255}( jQuery ));
256
257
258
259

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.