I’m trying to make API calls to Hubspot based activity on the website without compromising PII. Also hubspot doesn’t support CORS policy and won’t accept API calls client side.
So I’m trying to use a Server Side Google Tag Manager Container for this.
How it’s set up:
- a GA event is created on form submissions using normal client side GTM
- that event is sent to the server container and is parsed through the Universal Analytics client.
- there is an event called Submitted
- I have a GET (I also tried POST) to https://api.hubapi.com/v1/contact/utk/{{hubspot-user-token}}/profile?{{hubspotapikey}}
- {{hubspot-user-token}} is taken from the GA event and is a dynamic variable
- {{hubspotapikey}} is a constant variable
The tag fires, but I keep getting a 404 response.
I haven’t tried the new api, because there doesn’t seem to be a way to get the Contact Id from hubspot user token (if there is, let me know as well).
What is wrong with my API call? How would I make a hubspot API call from Google Tag Manager Server Side Container?
And more importantly, how could I read the response in Google Tag Manager Server Side?
GTM server tags have built in http response tags, but it may need a custom tag template using Node JS.