update google analytics tag.
This commit is contained in:
parent
2152e4d435
commit
2b311fb88a
@ -31,14 +31,15 @@ add_action('wp_head', 'niu_add_google_analytics');
|
|||||||
function niu_add_google_analytics()
|
function niu_add_google_analytics()
|
||||||
{
|
{
|
||||||
echo <<<EOF
|
echo <<<EOF
|
||||||
|
<!-- Google tag (gtag.js) -->
|
||||||
|
<script async src="https://www.googletagmanager.com/gtag/js?id=G-7G7QBM2Z3Y"></script>
|
||||||
|
<script>
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
function gtag(){dataLayer.push(arguments);}
|
||||||
|
gtag('js', new Date());
|
||||||
|
|
||||||
<!-- Google Tag Manager -->
|
gtag('config', 'G-7G7QBM2Z3Y');
|
||||||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
</script>
|
||||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
||||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
||||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
||||||
})(window,document,'script','dataLayer','GTM-K6BD5N9');</script>
|
|
||||||
<!-- End Google Tag Manager -->
|
|
||||||
|
|
||||||
EOF;
|
EOF;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user