I need to add a code snippet to an external website button to get it to trigger/open my HubSpot popup CTA. HubSpot says to add the below classes to the button on the external website.
To add the HubSpot classes to your button on an external website, you need to modify the HTML of the button to include these classes. Here’s how you can update your existing button code:
download By adding the classes hs-cta-trigger-button and hs-cta-trigger-button-102818235839 to your button, you enable the HubSpot CTA to be triggered when the button is clicked.
Thanks for the reply. I understand that I need to update the HTML but I’m not sure how?
When I replace the div class or a class with that code snippet WordPress immediately tells me the HTML code is invalid and asks me to reset the button. So I’m not sure what the code should actually look like?
It looks like some of your reply might have been accidentally deleted or cut off??
Hi @EmmaMartins
If you’re already using HubSpot tracking code, then you’d be able to trigger that pop-up with the following code:
<div class=“wp-block-button hs-cta-trigger-button hs-cta-trigger-button-102818235839”><a class=“wp-block-button__link wp-element-button”>Download</a></div>
Let me know if it does not work.
Thanks.
Thank you for this. I did try this initially but I was trying to edit the HTML of a button block and it seemed to break the block. Once I added this as a string of custom HTML, it worked just fine
I am trying to do the same. Can anyone help with this? It should be simple but I am not able to figure it out. I have a WordPress site, using Elementor. I have an Elementor button that, when clicked, I would like it to trigger the HubSpot popup using the code snippet from HubSpot:
hs-cta-trigger-button hs-cta-trigger-button-184949777468
I do not know where to place this snipped code.