Referral Codes/ID with Buttons

  • 23 January 2014
  • 7 replies
  • 6 views

Just curious - I know you can include referral codes in the forms using hidden fields, and I can add an id to a standard link - but is there any way to include a referral id when formatting a button?

Thanks in advance for your help!


7 replies

Hey Courtney -

You can : pass referral sources, like pass UTM paramaters, to a hidden field on your Unbounce form.

Now, if you wanted to pass referral sources like UTM parameters from a click through page (a button), you’ll have to do that with a bit of Javascript. Placed the following script in theJavaScript button set the placement to “Head.”

<script> _$(document).ready(function() { _var params = window.location.search.replace(//g,'%20'); _var button = $('a[href]').each( function(i) { _this.href = this.href + params; _}); _}); _</script>   

Would that work for you? Let me know if I missed the mark and you’re after something else!
_

Hey Courtney -

You can : pass referral sources, like pass UTM paramaters, to a hidden field on your Unbounce form.

Now, if you wanted to pass referral sources like UTM parameters from a click through page (a button), you’ll have to do that with a bit of Javascript. Placed the following script in theJavaScript button set the placement to “Head.”

<script> _$(document).ready(function() { _var params = window.location.search.replace(//g,'%20'); _var button = $('a[href]').each( function(i) { _this.href = this.href + params; _}); _}); _</script>

Would that work for you? Let me know if I missed the mark and you’re after something else!
_

Hey Courtney -

You can pass referral sources, like pass UTM paramaters, to a hidden field on your Unbounce form.

Now, if you wanted to pass referral sources like UTM parameters from a click through page (a button), you’ll have to do that with a bit of Javascript. Placed the following script in theJavaScript button as is and set the placement to “Head.”

<script> _ <br /> $(document).ready(function() {
<br /> _var params = window.location.search.replace(//g,'%20'); _ <br /> var button = $('a[href]').each( function(i) {
<br /> _this.href = this.href + params;
<br /> _});
<br /> _}); _ <br /> </script>   

Would that work for you? Let me know if I missed the mark and you’re after something else!
_

Hey Courtney -

You can pass referral sources,
like UTM parameters to a hidden field on your Unbounce form

Now, if you wanted to pass referral sources, like UTM parameters, from a click through page (a button), you’ll have to do that with a bit of Javascript. Place the following script in the JavaScriptbutton as is and set the placement to “Head.”

<script> _ <br /> $(document).ready(function() {
<br /> _var params = window.location.search.replace(//g,'%20'); _ <br /> var button = $('a[href]').each( function(i) {
<br /> _this.href = this.href + params;
<br /> _});
<br /> _}); _ <br /> </script>   

Would that work for you? Let me know if I missed the mark and you’re after something else!

Worked like a charm - thank you so much! I guess I need to brush up on some javascript.

Glad to hear Eric! Don’t worry our buttons don’t capture parameters by default, so JavaScript wizardry is not expected nor required!

Userlevel 3

Hey everyone!

We just added the ability to pass incoming URL parameters to your click through button links. Check out the support article below for details.

http://support.unbounce.com/entries/2…

Reply