How can I embed a call-to-action button within a Custom HTML block in HubSpot?

I’ve been trying to figure out how to add CTA buttons inside Custom HTML modules in HubSpot. I found some documentation that explains how to insert call-to-action buttons on regular web pages, but I can’t seem to find clear instructions for adding them specifically within Custom HTML blocks.

I’m working on a landing page where I need more control over the layout and styling, so the Custom HTML module seems like the best option. However, I want to make sure the CTA buttons still track properly and integrate with HubSpot’s analytics.

Has anyone successfully done this before? I’d really appreciate any guidance or step-by-step instructions on how to properly implement CTA buttons in Custom HTML modules while maintaining their tracking functionality.

Use HubSpot’s CTA token system in your Custom HTML block. Don’t hardcode buttons - just reference existing CTAs with the {% cta %} HubL token and your CTA’s GUID. This keeps all tracking intact since HubSpot automatically renders the proper tracking scripts. Grab the GUID from your CTA’s URL when you’re editing it - it’s those numbers and letters after the last slash. The syntax is {% cta “your-guid-here” %}. I’ve done this on multiple client projects and it works perfectly with custom styling. You can wrap the token in div containers and add CSS classes for custom looks without breaking the analytics.

I’ve run into this same issue tons of times with custom landing pages. Skip trying to build the button HTML yourself - just use HubSpot’s CTA embed code instead. When you create your CTA in the tool, HubSpot spits out embed code with all the tracking stuff built in. Copy that code and drop it straight into your Custom HTML module wherever you want the button. It’ll look like a script tag with data attributes pointing to your CTA ID. This keeps all your analytics and conversion tracking intact - something you’ll lose if you just make a regular HTML button. Don’t grab the direct URL from the CTA dashboard. You need the actual embed code since it has the JavaScript that makes the tracking work properly.

There’s another route if you don’t want to deal with tokens or embed codes. Create your CTA button in HubSpot first, then head to the CTA dashboard and find “get code.” You’ll see a direct link option that works with regular HTML anchor tags. Style it however you want, just add the HubSpot tracking parameters to the URL (the utm_source stuff). Perfect when you need complete design control but still want click tracking.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.