Solved

Just Launched: Pass Incoming URL Parameters to Outgoing Button Links


Hey everyone!

If you’re using a click-through page you might want to send your visitor along with the URL parameters they arrived with. This is super handy if you’re running any kind of PPC campaigns with Google Adwords, or the like!

Check out our new support article that’ll walk you through how to set this up!

icon

Best answer by Johnny_Opao 19 May 2014, 23:12

View original

35 replies

Hi Rob,

You can find it here:
http://help.therapyinbaltimore.com/couples-therapy/a.html

Thank you.
Alex

Userlevel 6

Can you share the page URL with me so I can take a look for you and hopefully find an answer? Feel free to shoot an email over to support@unbounce.com as well and I can help you out there 🙂

Hi Rob,

Thank you for getting back to me. The issue is that this approach doesn’t
seem to be working. I’ve have the hidden field set up, and when I try it
with a test url using ?gclid=12345, the page it redirects to has the form
fields referenced in the URL, but not the gclid.

Thank you.
Alex

Userlevel 6

Hi @Alexs you can do this with a form by collecting the incoming URL parameter values using hidden fields in your form. For example a hidden field called GCLID in your Unbounce form will automatically grab the gclid value form the URL parameter.

You can then click the “Append Form Data to URL” checkbox option in the properties panel when the form is selected and that value will be passed through as a URL parameter after the form is submitted.

Here’s some docs on it as well - http://documentation.unbounce.com/hc/en-us/articles/203799174-Adding-and-Editing-Form-Fields/#content4

Hope this helps!

It doesn’t look like this works for form completions. So if someone fills out a form and it’s set to redirect to a Thank You page on the website, only the values in the form fields get passed on, but not the GCLID info. So it works for click thru buttons but not forms for some reason.

Has this been addressed somewhere?

Great question 

Hello - Any suggestions for passing URL data from subdomain.domain.com to a TypeForm embed code on a lightbox page? I ld like to pass the gclid from URL through Typeform form. Thanks!

Good find, Luisa!

Good to know, Luisa!  Thanks for sharing 🙂

Never mind, I figured it out and tested it and it worked! replace the word text for the word image 🙂

Hello!!, how would this code change for image links?

Thank you!!

Thanks for this

Great! Thanks!

Userlevel 3
Badge +1

Hi Matt - Unbounce will force any form field names to lowercase and replace any spaces in the names with underscores. You can use some Javascript to rename the fields though.

<script> <br />
$('#fieldname).attr('name', 'NewFieldName');
<br /> </script>   

Replace “fieldname” with the current field name and then NewFieldName with what you’d like the parameter to be.

This will work for adjusting from lowercase to capitals and also for renaming mobile_number to MSN.

One thing that you will see is extra columns in your View Leads section–this method creates an extra column in the back end, so the old tp1 and new TP1, etc will both exist when you View Leads.

Also, I need some help regarding labels.

I am using Mobile Number as a form entry box label. However, when the URL parameters are appending I need the parameter to be ‘MSN’ rather than ‘Mobile_Number’. Is this possible?

thanks,
Matt

Hi guys,

This feature only seems to work with lower case characters.

E.g My system understands TP1 & TP2, but when the url parameters are passed onto my landing page URL, Unbounce changes the case to tp1 & tp2.

Is this a known issue?

thanks

Userlevel 3

Correct - Just paste that into your Unbounce page and it’ll work its magic 🙂

Great. But just to clarify - this javascript code you put in there is important, right?

Userlevel 3

Hey Mark-the-coolest-unbounce-user

It certainly does! It takes any and all parameters and passes them through to the page specified on your text link.

Hey Johnny-the-best-support-member,

Does this apply for GCLID as well?
For example, Adwords passes the gclid on all ad clicks. Then, when the user lands on the page (say sub.domain.com) and clicks on the text link over to another page of the same site (say domain.com), will the GCLID be carried over there by using the script you just pasted?

Thanks!

Hey Brad - the Properties Panel is contextual, meaning that it changes based on whatever you’ve got selected on your page. If you select that second button, you should see the panel change to that particular buttons properties where you can then update its Click Action.

Give that a shot but let me know how it goes.

Found it…now if I can just figure out how to get a “Click Action” property with a second button I added…

I can’t seem to access the “Properties” tab on my editor–just “Page Properties” and “Conversion Goals”. I can turn my campaign back on just as soon as I can pass through to the outgoing button…but I don’t know how to access the Properties tab on either of my pages!

Userlevel 3

Hey Karen - Try the script below. It will append incoming parameters to all text links on your page

<br />
$(document).ready(function() {
<br />
  var params = window.location.search.replace(/ /g,'%20');
<br /><br />
  var textLink = $('.lp-pom-text a').each( function(i) {
<br />
    this.href = this.href + params;
<br />
  });
<br />
});
<br /> </script>```   
 
Hope this is what you were looking for!

I did something similar with our UTM code but appended it to the form on our landing page.

<script>
<br /> $(document).ready(function() {
<br /><br />
/// _GET Params <br />
var params = window.location.search.replace(//g,'%20');
<br /><br />
/// Remove first ? <br />
params = params.substr(1); <br /><br />
/// explode the params by & <br />
var parts = params.split('&'); <br /><br />
for(var i in parts) { <br />
  var chunks = parts[i].split('='); <br />
  $('body form').append("<input type='hidden' name='" + chunks[0] + "' value='" + chunks[1] + "' />"); <br />
} <br /><br /> });
<br /> </script>   

Reply