- Priority: 0
- Status: Closed
- Theme: Alysum
-
Assigned To:
Fred
- Private: No
- Open Date: 03.11.20, 14:04
- Opened by: cavozzi
- Closed by: Anonymous Submitter
- Closed on:
- Reason: Not a bug
Ticket #19680 - Google ananlytics new version
i’m trying to add new google analytics G4
my global code is G-BGFH9YPY3P
and script is:
<!– Global site tag (gtag.js) - Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=G-BGFH9YPY3P“></script>
<script>
window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date());
gtag('config', 'G-BGFH9YPY3P');
</script>
how to add code and tracking to desktop and mobile ?
thank you
Comments
Hi, cavozzi.
Please use Google Analytics module what you can find in your back office where you have to add an ID only
ok but if i put G-BGFH9YPY3P don’t work (i try on analytics and system don’t show user online)
Google analytics has changed and the UA code no longer exists
Ok, I just added your code into the file
/public_html/themes/alysum/templates/_partials/footer.tpl
thank you, the code work also on mobile version?
no for mobile, add that your ID to the AMP module settings
mmmm desktop work, mobile no ( i don’t see user from mobile on live analytics)
i try again, nothing
are you looking for?? thank you
AMP version on analytic is invisible.
<!– Global site tag (gtag.js) - Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=G-BGFH9YPY3P“></script>
<script>
</script>
if you are using Google Tag manager you have to add your ID here https://take.ms/0rfSx
yes i create the tag, do you can check if it work?
<!– Google Tag Manager –>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({’gtm.start’:
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-KTVGBN6’);</script>
<!– End Google Tag Manager –>
<!– Google Tag Manager (noscript) –>
<noscript><iframe src=”https://www.googletagmanager.com/ns.html?id=GTM-KTVGBN6” height=”0” width=”0” style=”display:none;visibility:hidden”></iframe></noscript>
<!– End Google Tag Manager (noscript) –>
as I can see the code is present in the AMP pages https://take.ms/fgp2E7
Ok perfect. There is a system to check in realtime if analytics take the data?
thank you
I checked on google analytics but mobile visits are not recorded :(
Are you looking for? thank you
We have checked out everything once more and everything is correct in the code.
We have followed this google tutorial how to add Google Tag manager https://support.google.com/tagmanager/answer/9205783?hl=en
Please read it carefully and configure your google account as described there
i have already use the google tag manager tutorial.
But analytics don’t take mobile…
did you configured it for AMP as described in the tutorial?
yes, but it don’t work
The thing what we as developers have to do are pretty easy
1. Add an analytics script - Done
2. Call google tag manager config - Done
All other configuration steps are on your side
You can disable AMP if you want
i have created the tag, but don’t work, this is the code of my tag:
<!– Google Tag Manager –>
<amp-analytics config=”https://www.googletagmanager.com/amp.json?id=GTM-NRVD3H2>m.url=SOURCE_URL” data-credentials=”include”></amp-analytics>
if you take a look into the source code you will see the tag is present on your page https://take.ms/a6lCK
ok is present, but analytics don’t see mobile visit… :(
but what I have to do? We already added a code as google asked us
ok i tre-try to see if analytics see mobile visit
these are two easy steps what google ask us to do https://support.google.com/tagmanager/answer/9205783?hl=en and we did both of them
1. analytics script is added
2. google tag manager called