PageSourceSearch

https://www.nin.rs/files/js/GA4.js?v=1790285531

js nin.rs collected 2026-09-24 21:33:08 UTC 4,605 bytes, 174 lines download raw bytes

1$(document).ready(function () {
2
3    // GA4 - view item list 
4    var trenutnaPutanja = window.location.pathname;
5    var trenutniUrl = window.location.href;
6    if(trenutnaPutanja == "/subscription"){
7
8      gtagLayerPush({
9        event: 'view_item_list',
10        items: [
11            {
12                item_id: 'prod_P3iuAvD94eyE24',
13                item_name: 'Pretplata 1 mesec',
14                price: 9.99,
15                currency: 'eur',
16                quantity: 1,
17            },
18            {
19                item_id: 'prod_P3jABJZsMzoH3L',
20                item_name: 'Pretplata 6 meseci',
21                price: 59,
22                currency: 'eur',
23                quantity: 1,
24            },
25            {
26                item_id: 'prod_P3jC2sWsV5FNdu',
27                item_name: 'Pretplata 12 meseci (popust 50%)',
28                price: 49.6,
29                currency: 'eur',
30                quantity: 1,
31            }
32        ]
33    });
34
35    }
36
37    // GA4 - share button
38    const shareButtons = document.querySelectorAll('.share-button');
39    shareButtons.forEach(button => {
40        button.addEventListener('click', function(event) {
41            
42            const shareType = this.getAttribute('share-type');
43            const url = this.getAttribute('data-url');
44            
45            // console.log(shareType, url);
46
47            gtagLayerPush({
48              event: 'share',
49              method: shareType,
50              link_url: url
51            });
52        });
53    });
54
55    // GA4 - add to cart
56    $('#1-month-sub').on('click', function(e) {
57        e.preventDefault();
58    
59        var priceId = $(this).data('product-id');
60        var itemId = $(this).data('prod-id');
61        var price = $(this).data('product-price');
62        var name;
63
64        name = "Pretplata 1 mesec";
65        
66    
67        // console.log(' add to cart  ',price, priceId);
68        gtagLayerPush({
69            event: 'add_to_cart',
70            currency: 'eur',
71            value: price,
72            items: [{
73              item_id: itemId,
74              item_name: name,
75              price: price,
76              quantity: 1,
77            }]
78          });
79    });
80     // GA4 - add to cart
81     $('#6-month-sub').on('click', function(e) {
82        e.preventDefault();
83    
84        var priceId = $(this).data('product-id');
85        var itemId = $(this).data('prod-id');
86        var price = $(this).data('product-price');
87        var name;
88
89       
90        name = "Pretplata 6 meseci";
91       
92    
93        // console.log(' add to cart  ',price, priceId);
94        gtagLayerPush({
95            event: 'add_to_cart',
96            currency: 'eur',
97            value: price,
98            items: [{
99              item_id: itemId,
100              item_name: name,
101              price: price,
102              quantity: 1,
103            }]
104          });
105    });
106     // GA4 - add to cart
107     $('#12-month-sub').on('click', function(e) {
108        e.preventDefault();
109    
110        var priceId = $(this).data('product-id');
111        var itemId = $(this).data('prod-id');
112        var price = $(this).data('product-price');
113        var name;
114
115        
116        name = "Pretplata 12 meseci (popust 50%)";
117    
118        // console.log(' add to cart  ',price, priceId);
119        gtagLayerPush({
120            event: 'add_to_cart',
121            currency: 'eur',
122            value: price,
123            items: [{
124              item_id: itemId,
125              item_name: name,
126              price: price,
127              quantity: 1,
128            }]
129          });
130    });
131    // GA4 - pretplati_se
132    //header mobile
133    $('.btn-subscription-mobile').on('click',function(e){
134      // e.preventDefault();
135      gtagLayerPush({
136        event: 'pretplati_se',
137        method: 'header',
138        link_url : trenutniUrl
139      });
140    });
141    //header desktop
142    $('.btn-subscription-web').on('click',function(e){
143      gtagLayerPush({
144        event: 'pretplati_se',
145        method: 'header',
146        link_url : trenutniUrl
147      });
148    });
149    //footer
150    $('.footer-subscription').on('click',function(e){
151      gtagLayerPush({
152        event: 'pretplati_se',
153        method: 'footer',
154        link_url : trenutniUrl
155      });
156    });
157    //in article 
158    $('#signup-div-subscribe-link').on('click',function(e){
159      gtagLayerPush({
160        event: 'pretplati_se',
161        method: 'in article',
162        link_url : trenutniUrl
163      });
164    });
165    $('#news-subscription-subscribe-link').on('click',function(e){
166      gtagLayerPush({
167        event: 'pretplati_se',
168        method: 'in article',
169        link_url : trenutniUrl
170      });
171    });
172
173});
174

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.