Hey I am trying to get google tag manager to see hubspot event. Eg. If a deal amount becomes greater than 0 how can I create an api call to view this data? Is it possible I have provided a sample code I have. Any help is apprecitated
<script>
var apiKey = {{HubSpot API Key Variable}};
fetch('https://api.hubapi.com/crm/v3/objects/deals/?archived=false', {
method: 'GET',
headers: {
Authorization: 'Bearer ' + apiKey,
}
})
.then(response => response.json())
.then(data => {
})
.catch(error => console.error('Error:', error));
</script>
Hi @NCharles0
WARNING: Any code you add to Google Tag Manager is publicly visible so you would be sharing your key with the world… essentially giving anyone access to your portal data!
Other than that - I don’t think I understand what you’re trying to achieve, can you please elaborate.
Thanks
Mike
Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of Webalite a HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.
Thank you for that update.
I am trying to have google tag manager see any time a deal is updated with certain properties. Example if the deal amount is greater than 0 it triggers the tag manager or if the deal stage is updated. Hopefully this clears things up a little