I have created 2 landing pages for a campaign we're running and in order to track which page phone leads are coming from, we've created two different phone numbers - one for each page. I want to put these numbers in the page header and page footer, replacing any other phone numbers that are already there.
How do I do this without editing other pages that may have this global content? Will I need to create seperate headers/footers for each landing page?
Assuming the content of your landing page is the same, here is a better alternative to creating two separate landing pages:
Using HubSpot hubL {{ request.full_url }}, we can retrieve UTM parameters from the current URL and use them as conditions to display one of the two different phone numbers.
In this case, you'll need to obtain the UTM parameters for both campaigns and then we can show different phone numbers based on the retrieved UTM data.
Here is an example:
Campaign UTM data:
Campaign 1 UTM: campaign1
Campaign 2 UTM: campaign2
Example code:
{% if "campaign1" in request.full_url %}
<< phone number for campaign #1 goes here >>
{% elif "campaign2" in request.full_url %}
<< phone number for campaign #2 goes here >>
{% endif %}
Assuming the content of your landing page is the same, here is a better alternative to creating two separate landing pages:
Using HubSpot hubL {{ request.full_url }}, we can retrieve UTM parameters from the current URL and use them as conditions to display one of the two different phone numbers.
In this case, you'll need to obtain the UTM parameters for both campaigns and then we can show different phone numbers based on the retrieved UTM data.
Here is an example:
Campaign UTM data:
Campaign 1 UTM: campaign1
Campaign 2 UTM: campaign2
Example code:
{% if "campaign1" in request.full_url %}
<< phone number for campaign #1 goes here >>
{% elif "campaign2" in request.full_url %}
<< phone number for campaign #2 goes here >>
{% endif %}
Yes in this instance, they will need to clone the templates. And in that new template insert their own header and footer with the new number. So there will be 2 templates which have their own header and footer.
Template A will have Header A and Footer A (with phone number ABC)
Template B will have Header B and Footer B (With phone number DEF)
Hope this helps!
If we were able to answer your query, kindly help the community by marking it as a solution.
@erod gave an excellent recommendation that I will echo. I would clone it then use local modules.
However, I would additionally recommend avoiding all of this as it may be a lot more work. It can also get very convoluted if you continue this strategy because you'll end up with tons of different numbers if you keep creating landing pages. Also, this could be confusing for SEO purposes, but again it depends on your actual setup and what your business is looking to achieve.
I would instead use analytics tools to be able to track which page is getting the most phone number calls. There are a few ways to do this, but I think you'll find much better results this way. Also would limit user confusion.
The solution depend on how your page is set up. A few questions:
Are you able to change the phone number directly from the landing page editor? Or, are the header and footer locked?
Rather than creating new footers and headers, it might be best to clone the page in the design manager and convert the global header/footer into local modules. Once you do this, make the local modules editable from the landing page editor. Once you do that, you can A/B test.
There are ways to do it where you don't have to clone the page template but when dealing with global modules, I like to err on the side of caution. It reduces the risk of making global changes and messing things up.