Get Google Analytics Client ID into Hubspot for ALL page views (Not just form submissions)
There are a lot of posts around getting the client id from google analytics by adding some javascript to your GTM and having it store the data in a hidden property on your form.
My issue is that we want to be able to track this information on all page views not just when a form is submitted. Is there a way that we can get the javascript to fire and to have Hubspot store this data with the user's HubID or some other user based attribute?
Get Google Analytics Client ID into Hubspot for ALL page views (Not just form submissions)
How would we do that? Would we fire the js on every page view? We'd have to validate the users id in Hubspot first before we could trigger the GA client id right?
Apologies for the delayed response; I have been out of the office.
Yes, you could fire the identify function on every qualifying page view. For example, you could use custom JavaScript to only trigger the function if a gclid parameter is in the URL.
Per your second question, which user ID would you be validating? The "external ID" mentioned in this documentation? If so, that doesn't require validation in HubSpot so long as you either also have the user's email or the ID has already been associated with an email from a previous identify event.
Thus, you could push the gclid value into HubSpot at the same time you are pushing it into the data layer.