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-frustratingInvalid 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 asGoogle Analytics 4(GA4), while the new tracking code format is calledMeasurement 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 theMeasurement 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 newMeasurement 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 theAdvanced Optionsduring 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.
You need to paste the new GA4 code in the header or use GTM, to measure user activity.
FYI UA code will no longer process new data in standard properties beginning July 1, 2023. So switching over to a Google Analytics 4 property will be the best option.
Jul 21, 202111:53 AM - edited Jul 21, 202111:54 AM
Top Contributor
Grab the Google UA code in the new GA4 format
edjusten Thanks for the explanation, but I still have a question. You describe how to create an additional UA based code during the GA4 property creation, as I understand it.
But if you then use a UA, a tracking code, in HS, rather than copy/paste the GA4 Measurement code in header, then will GA get the stream and info it needs to provide the enhanced measurement, or will you just be keeping the same analytics you already had with the original UA code? I'm fearful of replacing the existing UA code with something new that breaks our continuity to previous tracking and views.
Feb 23, 20214:36 AM - edited Mar 23, 20216:21 AM
Participant
Grab the Google UA code in the new GA4 format
Thanks for this. Sadly we created a GA4 property already and cannot add UA now. I think the question would be, does Hubspot plan to add the integration via the G-XXXXXXXX soon? Also are we missing out on much by not connecting this? Thanks!
EDIT: We just added the tracking via Google Tag Manager so we're set although this would long term be nice to have 🙂