Google Analytics

Post Reply
User avatar
courtil
Observer
Observer
Posts: 18
Joined: Mon Aug 21, 2017 9:57 am
Location: CROISETTE - FRANCE
Station model: Vantage PRO2
Software: CumulusMx Version 3043
Contact:

Google Analytics

Post by courtil » Sun Feb 04, 2018 1:32 pm

Bonjour à tous,

Google Analytics a changé son script :

Actuellement
**************************************************
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/j ... "></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'XXXXXX');
</script>

*******************************************************
Apparemment il ne serait plus opérant sur mon site METEOTEMPLATE
J'ai comparé avec les STATS recueillis auprès du FAI

J'ai bien entré l'id de Google Analytics dans le config

Pouvez vous m'en dire un peu plus à ce sujet

Merci

Cordialement

Michel dit Courtil
OS : Windows 10 Profesionnal
Vantage PRO2
Cumulus version 3.00 b 3043
Meteotemplate 17.0 Nectarine
http://lecourtilauxepines.eu
http://lecourtilauxepines.pagesperso-orange.fr

User avatar
Météo Daoulas
Observer
Observer
Posts: 11
Joined: Mon Oct 02, 2017 8:05 am
Location: Daoulas, Finistère, Bretagne, France
Station model: WS-2800-IT
Software: Weather Display
Contact:

Re: Google Analytics

Post by Météo Daoulas » Thu Feb 15, 2018 11:23 am

Bonjour Michel,

En effet, Google a changé son code de suivi pour Analytics.

L'ancien code était du format suivant :

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '<?php echo $GAcode?>', 'auto');
ga('send', 'pageview');

C'est ce que tu as actuellement sur Meteotemplate !

Tu peux changer ce code dans le fichier header.php par le nouveau code comme ceci :

<!--script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $GAcode?>"></script-->
<!--script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '<?php echo $GAcode?>');
</script-->

en enlevant bien-sûr les !-- et -- :D

A noter que l'ancien code fonctionne encore car j'ai bien les données enregistrées sur Google Analytics.
Cordialement,
Patrice

Image

Image

User avatar
courtil
Observer
Observer
Posts: 18
Joined: Mon Aug 21, 2017 9:57 am
Location: CROISETTE - FRANCE
Station model: Vantage PRO2
Software: CumulusMx Version 3043
Contact:

Re: Google Analytics

Post by courtil » Fri Feb 16, 2018 5:30 pm

bonjour,

Merci de tes conseils que je mets en application.

Bonne fin de journée

Cordialement

Michel dit Courtil
OS : Windows 10 Profesionnal
Vantage PRO2
Cumulus version 3.00 b 3043
Meteotemplate 17.0 Nectarine
http://lecourtilauxepines.eu
http://lecourtilauxepines.pagesperso-orange.fr

Post Reply