mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00
Use Google Tag Manager for integration with Google Analytics and honour DNT.
Per discussion and review on pgsql-www.
This commit is contained in:
@ -1,14 +1,14 @@
|
|||||||
/*
|
/*
|
||||||
* Initialize google analytics
|
* Initialize google tag manager for analytics integration
|
||||||
*/
|
*/
|
||||||
var _gaq = _gaq || [];
|
var DNT = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack || window.msDoNotTrack;
|
||||||
_gaq.push(['_setAccount', 'UA-1345454-1']);
|
if ((DNT != "1") && (DNT != "yes")) {
|
||||||
_gaq.push(['_trackPageview']);
|
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||||
(function() {
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
})(window,document,'script','dataLayer','GTM-WC97NKC');
|
||||||
})();
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fix scrolling of anchor links
|
* Fix scrolling of anchor links
|
||||||
|
Reference in New Issue
Block a user