PageSourceSearch

https://www.gites-de-france-22-35-56.fr/lib_2/js/foncs/tracking.js

js gites-de-france-22-35-56.fr collected 2026-10-07 13:38:31 UTC 6,939 bytes, 166 lines download raw bytes

1// Adrien 10/05/23 : Attention, ce fichier n'est plus utilisé sur la majorité des sites web excepté sur le compte client et le script de résa
2
3/*
4 * Ce fichier sert à tracker les clicks sur les liens du site
5 * Voici la liste exhaustive des liens qu'il track (IDPAGE)
6 *
7 * -DISPO (le tracking est positionné sur le javascript qui initialise le calendrier)
8 * -PLAN_INTERIEUR
9 * -SITE_WEB
10 * -DETAIL_PIECE (il ya un script pour detail piece donc il ne faut pas le comptabiliser)
11 * -DETAIL_PROMO
12 * -FORM_MAIL_CENTRALE (le tracking est positionné sur le javascript qui initialise le formulaire)
13 * -FORM_MAIL_PROP (le tracking est positionné sur le javascript qui initialise le formulaire)
14 * -ALBUM_PHOTO
15 * -FICHE_GITE 
16 * 
17 *
18 * Le tracker de la FICHE_GITE se fait sur le onload du document via le getXHTML_debut de Window
19 * ainsi que en fonction de l'idpage (idskull) courant (FICHE_GITE)
20 */
21
22function trackMe(ident,idpage,nouvelleVersion){
23	var adr="/lib_2/ajax/gereTracker.php";
24	var sending=getInfoSession()+"&ident="+ident+"&idpage="+idpage+"&nouvelleVersion="+nouvelleVersion
25	/*var xhr_local=creeObjHttpRequest();
26    xhr_local.onreadystatechange = function(){
27		if(xhr_local && xhr_local.readyState == 4){
28			var reponse = xhr_local.responseText;
29		}
30	}
31	xhr_local.open("POST",adr,true);
32	xhr_local.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
33	xhr_local.send(sending);*/
34    
35    jQuery.ajax({type: "POST",url: adr,data: sending});
36    
37}
38
39function executeGAFNGF(params){
40    // pour une gestion du mois de la date d'arrivée et de départ
41    var month;
42    (function($){
43    var objParamStringified = $('#inputParamsGAFNGF', $('#form_envoiMailProp')).val();
44    
45        // on essaie de parser les params, si on y arrive pas on sort.
46        var listeParams = eval('('+objParamStringified+')');
47        // mise en forme des dates et calcul de la quantité
48        var tabPartiesDateDeb = params.dateDeb.split("/");
49        var tabPartiesDateFin = params.dateFin.split("/");
50        var objDateDeb= new Date(tabPartiesDateDeb[2],tabPartiesDateDeb[1],tabPartiesDateDeb[0]);
51        month = new String(objDateDeb.getMonth());
52        if(month.length == 1)month = "0"+month;
53        listeParams.dateDeb = objDateDeb.getFullYear()+"-"+month+"-"+objDateDeb.getDate();
54        var objDateFin = new Date(tabPartiesDateFin[2],tabPartiesDateFin[1],tabPartiesDateFin[0]);
55        month = new String(objDateFin.getMonth());
56        if(month.length == 1)month = "0"+month;
57        listeParams.dateFin = objDateFin.getFullYear()+"-"+month+"-"+objDateFin.getDate();
58        var nbj2 = objDateDeb.getTime()/ 86400000;
59        var nbj1 = objDateFin.getTime() / 86400000;
60        var nbj = Math.round(nbj1 - nbj2);
61        nbj = Math.abs(nbj);
62        listeParams.quantite = nbj.toString();
63        listeParams.semaine = objDateDeb.getFullYear()+"-"+getNumSemaine(objDateDeb.getFullYear(),objDateDeb.getMonth(),objDateDeb.getDate());
64        listeParams.nbParticipant = params.nbParticipant;
65
66        // Yoann 24/03/2014 : ajout du préfixe wa. pour le tracking Wasabi avec Google Tag Manager
67        _gaq = _gaq || [];
68        _gaq.push(['wa._setAccount', listeParams.ID]);
69        _gaq.push(
70                    ['wa._setCustomVar',
71                        1,
72                        'Code_postal',
73                        listeParams.CP
74                    ]);
75        _gaq.push(
76                    ['wa._setCustomVar',
77                        2,
78                        'Nb_adultes',
79                        listeParams.nbParticipant
80                    ]);
81        _gaq.push(
82                    ['wa._setCustomVar',
83                        3,
84                        'date_debut',
85                        listeParams.dateDeb
86                    ]);
87        _gaq.push(
88                    ['wa._setCustomVar',
89                        4,
90                        'numero_semaine',
91                        listeParams.semaine
92                    ]);
93        _gaq.push(
94                    ['wa._setCustomVar',
95                        5,
96                        'type_resa',
97                        listeParams.typeResa
98                    ]);
99        
100    _gaq.push(
101                    ['wa._addTrans',
102                        listeParams.numResa,             // Order ID
103                        listeParams.affiliation,            // Affiliation
104                        listeParams.prixTotal,              // Total
105                        listeParams.fraisDossier,              // Frais de dossier
106                        listeParams.assurance,         // assurance
107                        listeParams.CP,                  // Code postal
108                        listeParams.dpt,                 // departement
109                        'FRANCE'                    // Country
110                            ]);
111    _gaq.push(
112                    ['wa._addItem',
113                        listeParams.numResa,              // Order ID
114                        listeParams.dpt+'_'+listeParams.codeProd,                // SKU
115                        listeParams.nomProd,                 // Product Name
116                        listeParams.categProd,               // Category
117                        listeParams.prixLoc,               // Price
118                        listeParams.quantite                 // Quantity
119                    ]);
120        _gaq.push(['wa._trackTrans']);
121        // on ajoute le script google analytics si il est pas déjà présent
122        if($("script[src$='google-analytics.com/ga.js']").length==0){
123            (function() {
124            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
125            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
126            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
127            })();
128        }
129        
130    })(jQuery);
131}
132
133function executeGTM_criteo(){
134    (function($){
135        var tabParamsGTM_criteo = $('#inputParamsGTM_criteo').val();
136        var listeParams = eval('('+tabParamsGTM_criteo+')');
137        
138        if (typeof(dataLayer)!='undefined') {
139            dataLayer.push({
140                'Transaction_Id': listeParams.Transaction_Id,
141                'Product_Id': listeParams.Product_Id,
142                'Price': listeParams.prix,
143                'event': 'Criteo_Contact'
144            });
145        }
146    })(jQuery);
147}
148
149function addEventGa(category,action,label){
150    (function($){        
151        var typeGa = $("#bodyPage").attr("data-ga-type");
152        if(typeGa==''){
153            return;
154        }
155        if(typeGa=="UA"){
156            if (typeof ga == 'function'){
157                ga('send','event',category,action,label);
158            }            
159        }
160        else{
161            var _gaq = _gaq || [];
162            _gaq.push(['_trackEvent',category,action,label]);
163        }
164    })(jQuery);
165    
166}

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.