PageSourceSearch

https://www.fin-bot.co.il/wp-content/plugins/events-tracker-for-elementor/frontend/js/app.js?ver=1748433047

js fin-bot.co.il collected 2026-09-24 13:31:49 UTC 5,248 bytes, 193 lines download raw bytes

1(
2	function ( $, window, document ) {
3		'use strict';
4
5		$(
6			function ( $ ) {
7
8				/**
9				 * Buttons, headings, images.
10				 */
11				$( document ).on(
12					'click',
13					'[data-wpl_tracker] a:not(.events-tracker-for-elementor-exclude)',
14					function ( event ) {
15						var $link    = $( this ),
16							href     = $link.attr( 'href' ),
17							target   = $link.attr( 'target' ),
18							lightbox = $link.data( 'elementor-open-lightbox' ),
19							options  = $link.parents( '.events-tracker-for-elementor' ).data( 'wpl_tracker' );
20
21						// Отменим переход по ссылке.
22						event.preventDefault();
23
24						/**
25						 * Если есть ссылка для перехода, добавим задержку, чтобы трекинг успел отработать.
26						 *
27						 * Магия правил:
28						 *
29						 * 1. `'%23' !== href.substr( 0, 3 )` - когда по кнопке открывается попап
30						 * 2. `href && '#' !== href` - когда ставят пустые ссылки
31						 * 3. `( ! lightbox || 'no' === lightbox )` - когда по кнопке открывается лайтбокс.
32						 */
33						if ( href && '#' !== href && '%23' !== href.substr( 0, 3 ) && ( ! lightbox || 'no' === lightbox ) ) {
34							track_element( options );
35							console.log( 'Click with link' );
36
37							/**
38							 * Open in new window.
39							 *
40							 * @link https://learn.javascript.ru/popup-windows
41							 */
42							if ( target && '_blank' === target ) {
43								window.open( href );
44							} else {
45								setTimeout(
46									function () {
47										document.location.href = href;
48									},
49									2000
50								);
51							}
52						} else {
53							track_element( options );
54							console.log( 'Click without link' );
55						}
56					}
57				);
58
59				/**
60				 * Forms, global forms.
61				 */
62				$( document ).on(
63					'submit_success',
64					'form[data-wpl_tracker]:not(.events-tracker-for-elementor-exclude)',
65					function ( event ) {
66						var $form   = $( this ),
67							options = $form.data( 'wpl_tracker' );
68
69						track_element( options );
70						console.log( 'Submit success' );
71					}
72				);
73
74				/**
75				 * Paypal Button.
76				 */
77				$( document ).on(
78					'click',
79					'button[data-wpl_tracker].elementor-payment-button',
80					function ( e ) {
81						const $button = $( this );
82
83						track_element( $button.data( 'wpl_tracker' ) );
84						console.log( 'Paypal success' );
85					}
86				);
87
88				function track_element( options ) {
89					if ( options.vkontakte ) {
90						track_vkontakte( options.vkontakte_event_name );
91					}
92
93					if ( options.yandex_metrika ) {
94						track_yandex_metrika( options.yandex_metrika_event_name, options.yandex_metrika_id );
95					}
96
97					if ( options.gtag ) {
98						track_gtag( options.gtag_category, options.gtag_action, options.gtag_label );
99					}
100
101					if ( options.adwords ) {
102						track_adwords( options.adwords_id, options.adwords_label, options.adwords_currency, options.adwords_value );
103					}
104
105					if ( options.analytics ) {
106						track_analytics( options.analytics_category, options.analytics_action, options.analytics_label );
107					}
108
109					if ( options.facebook ) {
110						if ( 'Custom' === options.facebook_event_name ) {
111							track_facebook( options.facebook_event_name_custom, 'trackCustom' );
112						} else {
113							track_facebook( options.facebook_event_name, 'track' );
114						}
115					}
116				}
117
118				function track_vkontakte( event_name ) {
119					if ( window.VK && typeof ( VK ) === 'object' ) {
120						VK.Retargeting.Event( event_name );
121					} else {
122						window.console.log( 'Vkontakte not loaded' );
123					}
124				}
125
126				function track_yandex_metrika( event_name, id ) {
127					if ( window.ym && typeof ( ym ) === 'function' ) {
128						ym( id, 'reachGoal', event_name );
129					} else {
130						window.console.log( 'Yandex Metrika not loaded' );
131					}
132				}
133
134				function track_gtag( category, action, label ) {
135					if ( window.gtag && typeof ( gtag ) === 'function' ) {
136						gtag(
137							'event',
138							action,
139							{
140								'event_category' : category,
141								'event_label' : label
142							}
143						);
144					} else {
145						window.console.log( 'Global Google Tag (gtag.js) not loaded' );
146					}
147				}
148
149				function track_adwords( id, label, currency, value ) {
150					if ( window.gtag && typeof ( gtag ) === 'function' ) {
151						gtag(
152							'event',
153							'conversion',
154							{
155								'send_to': id + '/' + label,
156								'value': value,
157								'currency': currency
158							}
159						);
160					} else {
161						window.console.log( 'Global Google Tag (gtag.js) not loaded' );
162					}
163				}
164
165				function track_analytics( category, action, label ) {
166					if ( window.ga && typeof ( ga ) === 'function' ) {
167						ga(
168							'send',
169							'event',
170							{
171								eventCategory: category,
172								eventAction: action,
173								eventLabel: label,
174							}
175						);
176					} else {
177						window.console.log( 'Google Analytics (analytics.js) not loaded' );
178					}
179				}
180
181				function track_facebook( event_name, type ) {
182					if ( window.fbq && typeof ( fbq ) === 'function' ) {
183						fbq( type, event_name );
184					} else {
185						window.console.log( 'Yandex Metrika not loaded' );
186					}
187				}
188			}
189		);
190	}
191)( window.jQuery, window, document );
192
193// eof.

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.