From version 5.3, Google Analytics Dashboard for WP provides full support for gtag.js tracking. This means that almost all features available for analytics.js tracking are also supported when enabling the new Global Site Tag tracking code.
Things to consider before switching to gtag.js
Here are a few things to consider before migrating to gtag.js:
- If you’re using Accelerated Mobile Pages, the AMP Client ID API is not supported yet (or I’m not yet aware of it being). This means that you probably won’t be able to uniquely identify and analyze a user’s experience across AMP and non-AMP content.
- If you’re using an Ecommerce tracking plugin, make sure the plugin supports the new Global Site Tag tracking code.
- Global Site Tag tracking uses the Enhanced ecommerce library by default, so you won’t be able to switch to Ecommerce or to Disable in plugin’s settings.
- If you have defined custom events, outside of the GADWP plugin, make sure you update the code accordingly.
- forceSSL parameter is set to true in gtag.js, so you won’t be able to disable it from plugin’s options.
- To track user timing, Navigation Timing API is used. The rate at which timing events are sampled is determined by the total number of pageviews received during the previous day. These being said, the Speed Sample Rate setting is completely ignored.
To wrap things up, the most important issues you should be aware of, are the first two. Beside these, there are no notable things to consider.
Adding gtag.js to your site
Since almost all features available in GADWP are supported by gtag.js, I’ve decided to introduce a simple switch on/off button on the main Tracking Code screen, under Google Analytics -> Tracking Code.
To switch from analytics.js to gtag.js simply enable the option called use global site tag gtag.js (not recommended).
Other Release Notes
- In Google Analytics Dashboard for WP v5.3 I’ve also added support for custom dimensions while tracking AMP pages using Google Tag Manager.
- Google Tag Manager now has a native scroll depth tracking feature, available for both AMP and Web containers. For this reason, the GADWP’s scroll depth tracking feature is not available anymore in tag manager mode. Please use the native feature instead.
- Button submits are now also tracked when track form submit actions option is enabled.
- Users upgrading from a version lower than GADWP 5.2 will automatically be using the GADWP EndPoint.