CMS Development

TMisuna
Contributor

Can I insert a custom parameter variable in the URL field that changes depending on the page?

SOLVE

I'm creating a CTA button using HubSpot's CTA feature with "Embed" format.

I create a button like "Download Here" using HubSpot's CTA feature. I want to set the URL in the CTA button's URL field as follows:

 

https://example.com/download?myCTA?from=/mycolumn/XXX  

 

The "XXX" part above should contain the slug of the source column page. In other words, I think I need some mechanism to make it a variable. The source page is a URL of an article within HubSpot's blog type.

Specifically: I think I need to either extract and reflect the trailing digits from the URL of the page where the CTA is embedded, or replace the XXX part with some kind of variable.

First of all, I'd like to know if the above can be achieved given HubSpot CTA's specifications. By placing the CTA button, I want to track "which page the user came from" in GA4.

Can I insert a custom parameter variable in the URL field that changes depending on the page?

0 Upvotes
1 Accepted solution
alyssamwilie
Solution
Recognized Expert

Can I insert a custom parameter variable in the URL field that changes depending on the page?

SOLVE

I'm not sure I'm understanding exactly what information you're wanting to place in the URL, but I will confirm its possible to use HubL in CTA URLs to add dynamic information to them. For example to grab the URL of the current page you would add {{ content.absolute_url }} to the URL or {{ content.slug }} for the page slug.

Like so:

Screenshot 2025-10-03 095305.png
You can see a list of default HubL variables available in HubSpot's documentation here: https://developers.hubspot.com/docs/cms/reference/hubl/variables


If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developer at Lynton

Learn HubL | Get Marketing Insights

Lynton's HubSpot theme Rubric now available. Click to download.

View solution in original post

4 Replies 4
alyssamwilie
Solution
Recognized Expert

Can I insert a custom parameter variable in the URL field that changes depending on the page?

SOLVE

I'm not sure I'm understanding exactly what information you're wanting to place in the URL, but I will confirm its possible to use HubL in CTA URLs to add dynamic information to them. For example to grab the URL of the current page you would add {{ content.absolute_url }} to the URL or {{ content.slug }} for the page slug.

Like so:

Screenshot 2025-10-03 095305.png
You can see a list of default HubL variables available in HubSpot's documentation here: https://developers.hubspot.com/docs/cms/reference/hubl/variables


If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developer at Lynton

Learn HubL | Get Marketing Insights

Lynton's HubSpot theme Rubric now available. Click to download.
TMisuna
Contributor

Can I insert a custom parameter variable in the URL field that changes depending on the page?

SOLVE

Thank you for your thoughtful response.
I didn’t know that variables could be used in the URL field.
That seems to solve the issue.

0 Upvotes
chighsmith
Community Manager
Community Manager

Can I insert a custom parameter variable in the URL field that changes depending on the page?

SOLVE

Hi @TMisuna,

Thank you for posting to the Community!

I understand that you want to know if HubSpot’s CTA feature allows you to dynamically insert a page-specific variable, such as the article slug, into the CTA button’s URL field so you can track which page a user came from in GA4.

I'd like to tag in some of our Top Contributor to see if they have any ideas on this -- Hi @franksteiner79 @GeorgeBThomas and @ChristinaKay I hope you all are having a wonderful week! Do any of you have any suggestions for @TMisuna?

Thank you!

Cassie, Community Manager

 

 


 





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




TMisuna
Contributor

Can I insert a custom parameter variable in the URL field that changes depending on the page?

SOLVE

Thank you for your help

It looks like I’ll be able to solve it.

0 Upvotes