The Most Active and Friendliest
Affiliate Marketing Community Online!

“AdsEmpire”/  Direct Affiliate

Passing dynamic parameters from url to external link in my site

PiniPoh

New Member
Hi!
First of all keep in mind that I have totally NO programming skills. I just have a blog with wordpress, where I promote some affiliate offers making full reviews or top-list (eg. top 5 best dating sites)

Now I want to promote one of these articles with google ads.

So let's say that the final URL that I'll use in Google Ads campaign: mysite.com/?source={keyword} and someone finds my article searching "dating" on google, clicking it. The final URL the user will visit will be mysite.com/?source=dating ... right?

Now the user will click one of the link I promote, that are EXTERNAL links of course.

What I need is that dynamic parameter to be "catched" in the links. So automatically all links will be externalsite.com/?source={keyword}

Is that possibile in some easy way?
Thanks!
 
edited**

so it is a utm_ value then?
you have to use in incoming URL and whatever {keyword} value might be ...
$keyword = $_GET['key utm_']
^PHP
there are ways to do this with a JavaScript and document.write(""); also

Hi!
Sorry for my late reply but I was studying a way to do it and finally did it!
and yes, I used document.write ahaha!
If someone wants to see the codes I used I can provide them

so it is a utm_ value then?
you have to use in incoming URL and whatever {keyword} value might be ...

Please forgive my ignorance, I have another doubt.
When I set a google ads (search only) campaign, and use dynamic value {keyword} in the ad, google will return for {keyword} the actual keyword used by the user in that moment anywhere I put it, also in the title and description... right?

So if I set:
title: best {keyword} for sale
description: find out the best {keyword} for sale
Final Url: mysite.it/?source={keyword}

in Google search user will see, if they find my ad searching "smartphones"
title: best smartphones for sale
description: find out the best smartphones for sale

and when they click my ad, the URL that opens, among all the other parameters they should also have ?source=smartphone

isn't that so?

Thanks!
 
where does the keyword=value come from?
edited**
So let's say that the final URL that I'll use in Google Ads campaign: mysite.com/?source={keyword} and someone finds my article searching "dating" on google, clicking it. The final URL the user will visit will be mysite.com/?source=dating ... right?
so it is a utm_ value then?
you have to use in incoming URL and whatever {keyword} value might be ...
$keyword = $_GET['key utm_']
^PHP
there are ways to do this with a JavaScript and document.write(""); also
 
Hi,
thanks again for your reply.

nevermind title, description and my initial question: I found the right solution and now I can successfully pass the value of a url parameter in a specific link in my page

So if the user is visiting mysite.it/?myparameter=12345
I can successfully make sure that all my links in my page will be something like: externaliink.com/?myparameter=12345

I did this because the I want the "myparameter" parameter of my external link to change dynamically... and it has to be the keyword the user used in his search on Google, before clicking my ad and landing in mysyte.it

SO, here is what happens:
  1. user search on google: "dating"
  2. user find my sponsored ad and click it. The keyword used MUST be "catched" in the url, so the user is visiting: mysite.it/?myparameter="dating"
  3. thanks to the fact he is visiting: mysite.it/?myparameter="dating", if he click my affiliate link in that page he is actually clicking: myaffiliatelink.com/?myparameter="dating"
So I can use that parameter for tracking and optimization purpose.
Now, I managed to achieve the point n.3 My question is, how can I get to work the point n.2?
 
google includes that 'source=keyword' in the link for you?

If I am not wrong, Google Ads can return this value through the token {keyword}
So if I put: mysite.it/parameter={keyword} in the Final Url of my ad in Google Ads, this SHOULD work... I'm not expert in google Ads and maybe I should move this topic in the right area of the forum, the coding is now fine and working ahah
 
No idea what google ads is doing today really
'source' would be the parameter key for that value
$_GET['source']; PHP
getUrlParameter('source'); JavaScript
 
Hi, no this is totally another matter, I've already read this.
What I need is in this other google support page: support.google.com/google-ads/answer/6305348
So I'm pretty sure I can make this work.

In "Available ValueTrack parameters" you can find all parameters I can add in my URL to get data from google Ads

Thanks for your support :)
 
No idea what google ads is doing today really
'source' would be the parameter key for that value
$_GET['source']; PHP
getUrlParameter('source'); JavaScript
I put it, also in the title and description... right?
no you would have to script that
I would use a PHP page
PHP:
<?php $input = $_GET['source']; ?>
<HTML>
<head>
<title>bla bla <?php echo "$input"; ?> bla blabla.</title>

This might lead to some grammatical anomalies:
the best 'smartphone' or 'smartphones' (plurals)
the best 'latest smartphone' <<< Wat?
 
Last edited:
good luck ...
we used a custom campaign id parameter that indicated the keyword or keyword group
myURL/?a=1234
1234 was a code that could be mapped to a character value

added***
Set up or edit a tracking template with ValueTrack parameters at the keyword level
  1. Click on the Keywords page menu.
  2. Hover over any entry in the new “Tracking template” column, and click when the pencil appears.
  3. Enter {lpurl}, a question mark, and then any ValueTrack parameters you want to use, separated by ampersands (&). For example, if you want to use the {matchtype} parameter, your tracking template would be: {lpurl}?matchtype={matchtype}
  4. Click Save.
that is like exact match or broad match (i think)

{lpurl}?source={keyword} ???

That's right, I guess... I'll try it tomorrow ahah
Doing so, users will land in mysite.it/?source={keyword};
Then, thanks to the javascript code I'm using, this parameter will automatically be catched and written in all the affiliate links url in that page, and I'll have a good segment to track in my stats, finding the best converting keywords.
It should work I hope.
Will find out next week ahah

I'll keep you updated and, if someone wants, I can copy/paste the javascript code I've tested to be working.
 
/?source=this_exact_keyword
not dynamic that's in the final URL you use for that ad.

read my last post again I had to add to it last link and quote.

Yep I've read it. I saw Karooya post too and that confirms my guess.
about: "{lpurl}?matchtype={keyword} "
"matchtype" is not necessarily a parameter, but another token I can use for tracking purpose.
for istance, I can make this: {lpurl}?myParameter={matchtype} and it will dinamically return "e", "p" or "b" indicating "exact", "phrase" or "broad".

What I will do is just {lpurl}?myParameter={keyword}, so it will dinamically return the exact keyword the user used before clicking my ad.
 
googleads includes that 'source=keyword' in the link for you?
never tried that with JS
  1. the JavaScript is going to have to be the first thing in the <head> if it will work at all
Code:
<script>
var keyword = getUrlParameter('source');
</script>

then script a document.write in the title and description

googlebot may not execute the document.write ;)
 
good luck ...
we used a custom campaign id parameter that indicated the keyword or keyword group
myURL/?a=1234
1234 was a code that could be mapped to a character value

added***
Set up or edit a tracking template with ValueTrack parameters at the keyword level
  1. Click on the Keywords page menu.
  2. Hover over any entry in the new “Tracking template” column, and click when the pencil appears.
  3. Enter {lpurl}, a question mark, and then any ValueTrack parameters you want to use, separated by ampersands (&). For example, if you want to use the {matchtype} parameter, your tracking template would be: {lpurl}?matchtype={matchtype}
  4. Click Save.
that is like exact match or broad match (i think)

{lpurl}?source={keyword} ???

see=read
{lpurl}?source={keyword} - Google Search

List of All ValueTrack Parameters in Google AdWords - Karooya

{lpurl}?matchtype={keyword}
^^ that may work?

For the Search Network: the keyword from your account that matches the search query, unless you are using a Dynamic Search ad, which returns a blank value. For the Display Network: the keyword from your account that matches the content.
 
Last edited:
/?source=this_exact_keyword
not dynamic that's in the final URL you use for that ad.

read my last post again I had to add to it last link and quote.
 
MI
Back