I’d love to retrieve some specific contact properties via use of Google Tag Manager so that I can store it in a variable field there.
In order to do this I figured I’d probably need to read the hubspotutk cookie so that I can then get a contact record by its vid. Then, I would need to fill a variable with the property I’m looking for, and then the rest of the GTM magic can happen.
Currently I’m a bit stuck on the first bit already. I’ve figured out a way to read the hubspotutk cookie but which API call should I then do? I’ve tried using this url:
with xxx being the content from the cookie, and the hapikey being my hapikey that I’ve gotten upon making a dev account. It seems as though the dev account is a completely different account than the one I’m trying to get data from. Would that API key still actually work then? Because for me it currently seems like that’s not the case.
Also, I think after I’ve retrieved the json in a variable (lets call it json) and I’d like to retrieve lets say the last name (as an example), I think i’d be using the command json.contacts.lastname.value, right?
I hope you guys can help me out!