While tooling around my HubSpot account over the weekend, I realized I had never added the Google Analytics (GA) integration to my account. It’s a straight-forward process:
- Set up a Google Analytics account
- Create a web property in the account
- Copy the UA code from the newly created property into HubSpot at the appropriate place
However, when I did this for my own account, the code looked something like G-XXXXXXXX rather than the more familiar UA-XXXXXXX. Further, when I plugged the code into my HubSpot page integration section, I was greeted with the ever-frustrating
Invalid tracking ID
error message.
Reaching back into GA, I looked in vain for anything that looked like the old familiar UA code, clicking in every link I could find in the interface, but came up empty-handed.
What gives?
As it turns out, Google has updated the GA script, retooling it for apps as well as web pages. The process is now known as Google Analytics 4 (GA4), while the new tracking code format is called Measurement ID. This is the code that looks like this: G-XXXXXXX.
Beginning in October 2020, all new web properties created in GA are created with the Measurement ID. The familiar UA-XXXXXXX code is not generated by default. But, as you might have surmised, HubSpot still requires the legacy UA-XXXXXXX format for integration. Has Google done away with the legacy UA code?
Fear not fellow HubSpotters, it’s still possible to access a UA code for use with HubSpot.
In order to generate a UA code, users will need to open the Advanced Options of the creation wizard when creating a new web property. The Advanced Options will include choices to create a UA code in addition to the new Measurement ID, or in lieu of the new code.
Once the web property is created, the UA code will be available for copy-and-paste into HubSpot, same as before.
FAQs
Can I add a UA code if the property was created after October 2020 without a UA code?
Once a property is created without a UA code, one can not be added. Instead, a new property must be created, accessing the Advanced Options during the process.
My customer added the UA code years ago. Will this update affect current GA tracking.
It will not. Any UA codes added prior to October 2020 remain functional in the same way.
Where can I find out more about this?
Check out the response from Carol Hill on this analyticshelp.io blog post.