Lead Capture Tools

Accelirate
Member

Want to Track Hubspot forms with Click Text "Download Now"

I want to Track Hubspot forms with Click Text "Download Now", but i am not able to track it.

Here is the process i have followed

Created a Tag

>>Tag Configuration >>Custom HTML

and placed this HTML code
<script type="text/javascript">
window.addEventListener("message", function(event) {
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmit') {
window.dataLayer.push({
'event': 'hubspot-form-data',
'hs-form-guid': event.data.id,
'hs-formData': event.data.data
});
}
});
window.addEventListener("message", function(event) {
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
window.dataLayer.push({
'event': 'hubspot-form-success',
'hs-form-guid': event.data.id
});
}
});
</script>

Then added a trigger to this tag Trigger >> Trigger Configuration >> Custom Event

Event name: hubspot-form-success >> Some Custom Events

and added this condition

Click Text Contains Download Now


then created a TAG for GA-4 Event

added measurement id >>

Event Name: Download_Now_Whitepaper >>

Event Parameter: Click_text
Value: {{Click Text}}

then fired this on "All Pages"


My Tags are firing but my all the forms on the website are created through hubspot forms and whenever, some one fills any form above tag got fired and tracked as Event but i only want to track forms having Click button "Download Now"

Please help me what i can do in it.

0 Upvotes
3 Replies 3
LouiseHare
Top Contributor | Partner
Top Contributor | Partner

Want to Track Hubspot forms with Click Text "Download Now"

Hi @Accelirate ,

 

Do you have any of the enterpise hubs? If so you should be able to use custom events to track this. 

 

You can read more about that here.

 

Thanks,

LouiseHare_0-1709049411269.png

Louise Hare she/her

Freelance HubSpot Specialist 

louisemhare.com

Want to chat HubSpot?

LouiseHare_1-1709049411271.png

 

If my reply helped to answer your question please mark it as a solution to make it easier for others to find!

Accelirate
Member

Want to Track Hubspot forms with Click Text "Download Now"

No, we dont have enterpise hubs, i want to do it through GTM and GA4

0 Upvotes
LouiseHare
Top Contributor | Partner
Top Contributor | Partner

Want to Track Hubspot forms with Click Text "Download Now"

Hi @Accelirate ,

 

Unfortunately I amn't able to help you with this. Hope you find somone that can!

 

Thanks,

LouiseHare_0-1709049411269.png

Louise Hare she/her

Freelance HubSpot Specialist 

louisemhare.com

Want to chat HubSpot?

LouiseHare_1-1709049411271.png

 

If my reply helped to answer your question please mark it as a solution to make it easier for others to find!