⚙ Operations Hub

FMay
Participant

Getting value from browser when executing workflow

I am pretty new to Hubspot but have a couple of workflows working. This one has defeated me though.

 

I have added Amplitude tracking in Hubspot. This generates an ID to uniquely identify the user in the CMS. This ID is generated and sent to Amplitude while the user is anonymous. This works fine.

 

When a new contact is added, I think I need to execute a workflow in order to call my backend. Using this approach I know the Contact ID but I don't know how to access the Amplitude ID, as it is only available via a function call in the browser.

 

Is there a simple strategy I am missing here? Hope it's clear enough.

 

Thanks

 

Freddy

3 Réponses
TomM2
Conseiller clé | Partenaire solutions
Conseiller clé | Partenaire solutions

Getting value from browser when executing workflow

Hey @FMay HubSpot doesn't "connect" to a visitors browser, meaning there's no way to retroactively have a system go back to the browser and grab more data. When a form is submit by a contact the form simply sends a cookie with the tracking information to HubSpot and it processes the analytics tracking. Data outside this isn't captured, it would need to be sent to HubSpot or another storage system at some point in order to be captured. 

One thing you could do is add a hidden field to your HubSpot form to store the amplitude ID for the contact in. 

 

You would then however need a script to grab the amplitude ID and pass it to that hidden form field, this would require some custom JS development. There's some guides on passing values to fields via JS. There's another post about how to set a value with custom JS available here

However you'll need something to actually capture the value itself from amplitude. 

 

There's also a pre-built Amplitude HubSpot integration which might be useful to you! https://ecosystem.hubspot.com/marketplace/apps/marketing/analytics-data/amplitude-engage

 

The only other option would be to create a script that automatically stores the amplitude information somewhere you always have access to, you'll then need to call that data through a webhook or custom code within your workflow. 

Tom Mahon
HubSpot Expert | Digital Marketing Specialist | Community Champion
HubSpark

Book a meeting

Did my post help answer your query? Help the community (and me) by marking it as a solution.


FMay
Participant

Getting value from browser when executing workflow

Thanks Tom. All very useful information.

 

In the end I solved the problem by including a script in the footer that checks if I have already sent the User ID (got using simple Hubl inject) to amplitude by writing to  localstorage. If not in localstorage, it sends it. If it is, then it ignores.

 

The Amplitude integration doesn't really do what I need across the board as it happens.

 

Thanks for getting back to me in any case. Been a steep but pretty enjoyable learning curve!

 

Freddy

TomM2
Conseiller clé | Partenaire solutions
Conseiller clé | Partenaire solutions

Getting value from browser when executing workflow

Oh fair play! That does sound like a bit of a learning curve alright! Happy I could help somewhat! 

Tom Mahon
HubSpot Expert | Digital Marketing Specialist | Community Champion
HubSpark

Book a meeting

Did my post help answer your query? Help the community (and me) by marking it as a solution.


0 Votes