Thanks for the thorough response, Cathal!
For starters, I am trying to see if I can get any one of these values passed through to the form field on submission. I tried implementing your example for the cid, and you should now be able to see the code I’m using on my test page: https://headrushtech.com/jenna-test
And, here it is for your convenience:
<!--[if lte IE 8]>
<script charset=“utf-8” type=“text/javascript” src=“//js.hsforms.net/forms/v2-legacy.js”></script>
<![endif]-->
<script charset=“utf-8” type=“text/javascript” src=“//js.hsforms.net/forms/v2.js”></script>
<script>
hbspt.forms.create({
portalId: “5957371”,
formId: “d0cafa60-0992-43f0-aa2d-7edc0fbd3728”,
onFormSubmit: function($form) {
document.querySelector(‘input[name=cid]’).value = getCookie(“_ga”);
}
});
</script>
I went ahead and made the cid field hidden, as this is how it will ultimately need to be (good to know this does make a difference in how things are coded — appreciate you calling out that difference!).
Sadly though, it’s not passing the _ga cookie into the cid hidden field. That said, I haven’t actually set the _ga cookie as I was under the impression Google automatically does this. But, maybe that is not the case? What’s perhaps confusing is that when I inspect the page after entering the site through a Google search I can see the _ga cookie, so I asummed it’s set and stored and all I need to do is get it. Can you confirm?
Regardless, I think I could still use some guidence on setting and storing the cookie as well.
Thanks in advance for looking at this!!!