Update Google Analytics to gtag
See original GitHub issueI checked that…
- … the documentation does not mention anything about my idea
- … to my best knowledge, my idea wouldn’t break something for other users
- … there are no open or closed issues that are related to my idea
Description
Google has been sending me emails that analytics.js
is being replaced by gtag.js
and has a new code snip to use it.
Possibly related (although I think they are talking about a different feature, unless Google combined these): https://github.com/squidfunk/mkdocs-material/issues/1914
Use Cases
Anyone receiving the emails to update would stop receiving the emails 😄
Apparently Google lists the selling points as:
- Future-proof conversion measurement: Benefit from the latest features and integrations as they become available so that you’ll be better equipped to continue measuring conversions accurately if non-Google changes occur.
- Code-less tag management: Turn measurement features on and off within your Google Analytics account without having to manually change tags on your page.
- Faster and easier integration: Seamlessly implement and integrate with other Google products, such as Google Ads and Google Optimize.
Screenshots / Mockups
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-#######-#"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-#######-#');
</script>
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Migrate from analytics.js to gtag.js (Universal Analytics)
This guide walks you through the process of migrating an existing analytics.js Universal Analytics implementation to use gtag.js .
Read more >Add a Google Analytics 4 property (to a site that already has ...
In Google Analytics, click · In the Account column, make sure that your desired account is selected. · In the Property column, select...
Read more >How to Upgrade to Google Analytics 4 (GA4)?
Learn how to upgrade to Google Analytics 4. This blog post explains how to upgrade, why to upgrade, and when you should do...
Read more >How to Install Google Analytics 4 (Updated in 2022 ... - YouTube
Learn how to install Google Analytics 4 with GTAG or Google Tag Manager. Both options are explained. Google Analytics 4 is the latest ......
Read more >How to upgrade to Google Analytics 4 (2022) - YouTube
Learn how to upgrade from Universal Analytics to Google Analytics 4 (because UA will stop working in 2023). Create a new property, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
gtag.js
support just landed inmaster
and will be released soon. Feedback appreciated. Now, both formats are supported.Google Analytics
Google Analytics 4 (via
gtag.js
)@squidfunk sorry to necro this, but I am attempting to help a friend setup an mkdocs deployment with google analytics and it appears he is not able to setup anything except Google Analytics V4 which no longer provides a UA-##### and instead seems to require the use of gtags. since new GA users are forced to GA4 and existing users (myself included) are being sent emails from google urging them to upgrade it’s probably a good idea to reconsider this.
P.S. I upgraded one of my less important GA properties to GA4 and it no longer has a UA-##### and now only has the option to use gtags, which seem to give a measurement ID in the format G-ABC123.