APIs & Integrations

YizSeg
Contributor | Diamond Partner
Contributor | Diamond Partner

Send Google Analytics CID with form submissions without adding it as a field

G'day all,

 

I have a client that uses a mix of non-hubspot forms and hubspot forms. There are a bunch.

 

I have a custom property called ga_cid on the contact level. The normal value of this is taken from the Google Analytics CID, which can either be on the URL itself, if I decide to decorate the URL, or stored within the Cookie itself.

 

Either way, it can be retrieved with Google Tag Manager.

 

What I want to do is to send that value to the ga_cid property on form submission, to associate it with the user created, without having to edit the form (especially the non-hubspot forms).

 

Is this possible? Is there a way of sending it directly by finding out the hubspot temp or existing contact id for the page viewer using Google Tag Manager, and then sending it directly to the contact on Hubspot on form submission?

 

Or create a ghost form field?

0 Upvotes
6 Replies 6
Danylo
Member

Send Google Analytics CID with form submissions without adding it as a field

Hi. We've created a custom Google Tag Manager tag to inject GA CID form fields into Non Hubspot Forms, that can be still tracked by HubSpot. If you're about to track offline sales and/or offline conversions in GA, the CID field is by far not a single one you need to track to bypass GA filter as well as to send a proper GEO of a user, not a server. BTW, Zapier integration of HubSpot and Google Analytics doesn't even let to do so at all.

0 Upvotes
webdew
Guide | Diamond Partner
Guide | Diamond Partner

Send Google Analytics CID with form submissions without adding it as a field

Hi @YizSeg ,

It sounds like what they're looking for is to auto populate the form field with the "ga_cid" property that exists on the contact's record, you can explore the steps listed in this article:

https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string#create-dy...

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regards. 

0 Upvotes
YizSeg
Contributor | Diamond Partner
Contributor | Diamond Partner

Send Google Analytics CID with form submissions without adding it as a field

Hey @webdew ,

 

That involves adding form fields to the form. I do not want to touch existing forms. Also some forms aren't necessarily hubspot forms. I want to run this separately.

 

Cheers,

 

@YizSeg 

0 Upvotes
TiphaineCuisset
Community Manager
Community Manager

Send Google Analytics CID with form submissions without adding it as a field

Hi @YizSeg 

 

Thank you for reaching out.

 

I want to tag some of our experts on this - @tjoyce @Gonzalo @lynton do you have any thoughts for @YizSeg on this? 

 

Thank you!

Best

Tiphaine


Saviez vous que la Communauté est disponible en français?
Rejoignez les discussions francophones en changeant votre langue dans les paramètres !

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


YizSeg
Contributor | Diamond Partner
Contributor | Diamond Partner

Send Google Analytics CID with form submissions without adding it as a field

Thanks @TiphaineCuisset still haven't received a solution on this. Do you have anyone else that could help or any other resources I could look into?

0 Upvotes
YizSeg
Contributor | Diamond Partner
Contributor | Diamond Partner

Send Google Analytics CID with form submissions without adding it as a field

Thanks for tagging people @TiphaineCuisset .

 

In the meantime, I've looked into the following solution:

 

I looked into this solution, which is more of a 2 step solution.

I can get user token in Google Tag Manager and then request the user id using this method: https://legacydocs.hubspot.com/docs/methods/contacts/get_contact_by_utk

 

and from there use the contacts API to update the contact directly using this call https://legacydocs.hubspot.com/docs/methods/contacts/update_contact 

 

And I would fire this on form submission.

 

How would I do this 2 step process in google tag manager without getting a JSON response and make it dynamic use tag manager's variables? and this is a legacy API, which means that eventually it'll become deprecated and not usable.

 

Is it possible to make this work or is there a better way of doing that?