Product

Create, publish and optimize pages with a drag&drop, pixel perfect and mobile-friendly builder

Speed up the creation process with 400+ customizable templates for landing pages, pop-ups and sections

Track microconversions in your Dashboard and analyze events and clicks with visual map

Integrate your pages with your favorite mar-tech apps and solutions to get the flow of your campaign going

Drive sales and conversions with irresistible product displays and seamless shopping experiences

Use a reliable and secure platform that smoothly handles millions of visits

Resources

Master digital marketing with the help from savvy professionals and increase your website’s conversions

Guides for beginners, set-up instructions and creation tips to get started and optimize your pages

A free online course for landing page creators! Learn the secrets of high-converting pages and become an expert

Get the answers you’re looking for – contact us

Schedule a one-on-one meeting with us and learn more about the benefits of our platform

Home Help Center Pass UTMs to another URL after button click

Pass UTMs to another URL after button click

TABLE OF CONTENT

UTM parameters can be passed from one URL address to another after clicking the button. This guide will walk you through configuring forwarding UTMs to the target URL, and with this solution, conversions will still be tracked in your landing page Dashboard.

You can set all landing page buttons or a selected button to pass UTMs.

TIP: Beforehand, learn more about UTM basics – check the guide on collecting UTMs and automatic form filling.

Pass UTMs through all buttons

Set a redirection

1. Go to the editor of your landing page.

2. For every button that is supposed to pass UTMs to another URL address:

  1. click the button,
  2. unfold the Click Action tab,
  3. select the Redirection action,
  4. enter the target URL (without parameters),
  5. select the Track click conversion option (Open in a new tab is optional).

3. Publish your landing page.

Add a JavaScript code

4. Navigate to your landing page Dashboard.

5. Go to the JavaScript Code tab and add a new script.

6. Copy the following code:

<script>
$(function(){
$('.widget-button[subtype="redirect"]').each(function( index ) {
$(this).attr('href', $(this).attr('href') + '?' + window.location.search.substr(1));
});
});
</script>

7. Name (1) the script and choose the Body bottom (2) position on the Main page (3). Paste the code in the content field (4).

Save by clicking Add script.

Go to your published landing page and check if the parameters are passed correctly.

Pass UTMs through a selected button

Set a redirection

1. Go to the editor of your landing page.

2. For the button that is supposed to pass UTMs to another URL address:

  1. click the button,
  2. unfold the Click Action tab,
  3. select the Redirection action,
  4. enter the target URL (without parameters),
  5. select the Track click conversion option (Open in a new tab is optional).

Get the button ID

3. Unfold the Other tab and copy the button ID number.

4. Publish your landing page.

Add a JavaScript code

5. Navigate to the landing page Dashboard.

6. Go to the JavaScript Code tab and add a new script.

7. Copy the following code:

<script>
$(function(){
  $("#BUTTON_ID").attr('href', $("#BUTTON_ID").attr('href') + '?' + window.location.search.substr(1));
});
</script>

8. Change BUTTON_ID (twice) to the number copied from your button.

To add more buttons, duplicate the third line of the code and change BUTTON_ID for the ID of another button (do not forget about # before its number).

9. Name (1) the script and choose the Body bottom (2) position on the Main page (3). Paste the code in the content field (4).

Save by clicking Add script.

Go to your published landing page and check if the parameters are passed correctly.

Read our blog post to learn more about UTMs, landing pages, and online campaigns.