How to Track Keywords & Tell Which Keywords Convert
Posted on April 12, 2007 in Affiliate Tips, PPC, Keywords p>
First off thanks to all those who have used the new contact form it works great… almost to great as i got TONS of questions. So i decided to answer my first one today which revolves around tracking keywords for your campaigns and how to tell which ones convert. The Actual Question is:
How do I know which KeyWord is converting the best?
1. How Do You Know Which Keyword is converting best?
- First you have to Track your Keywords either using 3rd party software, custom software or simple code.
- The Simple code can take the searched Keyword and tag it in the subid placement.
Place this code in between your head tags:
<?php ob_start();
if(isset($_REQUEST[’kw’]))
{
$kw = preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).”";
$k1w = urldecode( $_REQUEST[’kw’] ).”";
}
else
{
$k1w = NULL;
}
?>
Place this code where you want the Keyword to appear in your Subid:
<? echo ( ( strlen( $k1w ) <6 ) ? “Default Text” : “$k1w\n” ) ; ?>
The Reason for the <6 is if the string is less than 6 characters the “Default Text” will be put in instead of Keyword brought in, u can change this number.
Now your Affiliate Link in your page will be like this:
“http://www.CPANETWORK.com/12345?subid=<? echo “$k1w\n”; ?>”
Now in Google or MSN you can Append your destination links with the Keyword Dynamically. So your destination Url will be:
http://www.somesite.com/?kw={Keyword}
Now once you Make thos changes your Keywords will be appearing in your Subid output in your CPA network. So you can see what keywords are producing leads and which ones aren’t. No you know which ones are producing leads you can delete keywords that aren’t producing leads. Do make sure you give enough time to see if the keywords really perform or dont perform. As in you don’t want to delete a keyword that only has one click but didn’t convert you want to look more at higher volume keywords that don’t convert, because the smaller volume the next click could be a lead.
Comments
40 Responses to “How to Track Keywords & Tell Which Keywords Convert”
Leave a Reply

















excellent info, been waiting for someone to simplify this!
great info!
Yeah, but now your merchant know which of your keywords convert (and they can take it).
Is there a way to mask this?
Yes there is a way to mask it but then you have to deal with more extensive programming and using databases to store the Keyword information etc.. Then go back and compare the information. There is also software out there and sites that will help in tracking them but none of them completely did what i wanted, so I had a backend custom built for this purpose.
One thing you can do is group your campaign keywords closely like 10 or 15 and use a tag for that group. Then you know the keywords and the nework doesn’t. I understand peoples concerns more than the network i would be more afraid of the affiliate manager running a campaign on their own… but this is part fo the reason why you have to develop a relationship and trust with the network and if you don’t have turst mask or use groupings to narrow things down.
what if your kw has a space for multiple word KW? how would it work for this: http://www.somesite.com/?kw={Keyword}?
Thanks.
Jimmy
When google or MSN passes the keyword there is spaces or the space coding. This code preg_replace(’/%20/’,’ ‘,$_REQUEST[’kw’]).””; takes care of that. The code will work for multiple keywords passed at once. Like “brown shoes” etc.
One thing I do to mask the keyword is to assign a unique ID to each of them. Assuming you’re working with
i have spent a few days searching forums for this kind of information - all in vain. thanks for sharing.
Nice useful tip! I agree with Garrett that using IDs is necessary if you do not want to share conversion information with your merchants…
First of all, thanks a lot CPA Affiliates!
I am looking for this information the last few days now and here it is…
———-
I still have one question though -
You mentioned:
“Now in Google or MSN you can Append your destination links with the Keyword Dynamically. So your destination Url will be:
http://www.somesite.com/?kw={Keyword}”
What about Yahoo Search Marketing?
CPA Affiliates,
I went to my Azoogle account and pasted your code
into my Sub ID box, next my tracking url with Azoogle became like:
http://x.azjmp.com/0W3cM?sub=%3C%3F%20echo%20%28%20%28%20strlen%28%20%24k1w%20%29%20%3C6%20%29%20%3F%20%u201CDefault%20Text%u201D%20%3A%20%u201C%24k1w%5Cn%u201D%20%29%20%3B%20%3F%3E
Also ? mark next to Sub ID box tells me that “You cannot use any of the following characters in your subids: ;,/?:@=#&+$%^!()~’”
These characters will be stripped from the input.”
Any suggestions how to resolve this?
Many thanks!
Mike
Mike,
You don’t add it in your Azoogle or any othe CPA network account.
You take this url from azoogle or whatever CPA network (well the offer url you want to append the ID to) http://x.azjmp.com/0WF3v?sub=
then add the code as stated in the post but the click link will be like this
http://x.azjmp.com/0WF3v?sub=< ? echo “$k1w\n”; ?>
Also for Yahoo Search Marketing Enable EasyTrack in your account. It will auto-append your destination url with keywords.
Hope that makes it clearere for you.
Thanks a lot CPA Affiliates!
1. I understand what I should ad as subid for my affiliate link or click link, but still don’t understand where I place your 2nd mentionend code:
2. I guess for YSM I don’t have to add to my destination url /?kw={Keyword}, because EasyTrack is already enabled and your other codes I still should place on my page!
3. Besides tracking which keywords convert, is there something we can add to code or destination url in order to see as well if keyword is from Adwords, Adcenter or YSM? Most likely you going to use same keywords for all of them!
Thanks again.
Mike
the second code is the click link code but set with a default text meaning
http://x.azjmp.com/0WF3v?sub=< ? echo ( ( strlen( $k1w ) <6 ) ? “Default Text” : “$k1w\n” ) ; ?>
so if no keyword was passed your link would be
http://x.azjmp.com/0WF3v?sub=Default Text
As far as something different fo Each Se you promote on you can do this Just place some text prior to the link (this is assuming you aren’t sending the different results to the same page/link, meaning you have a page for google one for msn etc…)
http://x.azjmp.com/0WF3v?sub=Google< ? echo ( ( strlen( $k1w ) <6 ) ? “Default Text” : “$k1w\n” ) ; ?>
As shown above just put in some text to represent the SE the link came from then it will jsut ad the keywords after it.
Keep in mind this is for VERY simple tracking…
For some reason my previous reply today didn’t show your code I posted!
I will try again:
I followed your steps, but my ad network sub id stats show now exactly your click link code (3rd code you added after sub id of affiliate link) but no keywords!
Any idea what I do wrong?
Hi there,
This sounds like a fantastic script. I have tried to get it to work but when I test the file on the server I get the following error :
Parse error: syntax error, unexpected ‘%’
I have placed the code in the head of the destination page and also in the correct place for the link.
Any idea what I am doing wrong?
Thanks,
Neil
Michael,
Did you edit the URL that you are sending your PPC’s thru to tag the keyword on? Also make sure your file for the site is php or you set in your htaccess to process .htm or .html files as php.
Neil,
Unfortunately I don’t know why you would be getting that error. If you did everything i showed in the post it should work as i have used this code in the past for simple tracking.
I’m working with YSM of most of my campaign, could you direct me to where I can find this EasyTrack option you mention for YSM? is it in Admin>Tracking URLs? if so I just see and option for ON and OFF, but nothing about EasyTrack. Also do I still need to include your php code on my LP to have EasyTrack to work?
Your help will be great appreciated!
Thanks CPA Affiliates!
Yes, my file is .php & added /?kw={Keyword} to my destination url!
My destination url with Adcenter is something like this:
http://www.test.com/test.php/?kw={Keyword},
whereby test.php has your 1st mentioned code inside as well a redirect php script (the redirect has my affiliate url inside plus I added your 3rd mentioned code).
Unfortunately, I am still not able to get things work, don’t know what I am doing wrong…
Neil,
/%/ >> remove // then it will work!!
Its a little bit more work, but if you want to remove keyword from your URL you can do so quite easily with excel.
This post prompted me to explain how I do it on my blog.
Thanks for the script and the prompt to get me to write a post!
Dennis
With easy track on it appends it to the end of your url so this would be your url http://www.CPANETWORK.com/12345?subid= Everything else still applies.
Micheal,
This should fix your issue
http://www.test.com/test.php?kw={Keyword}
or take your test.php rename it as index.php and put it in folder called test then your link would be like this
http://www.test.com/test/?kw={Keyword}
I start to think know that my network causes the problem why I can’t get your codes work…
My network uses DirectTrack!
Does your codes work with networks who use DirectTrack?
This means that you have to depoly unique urls to match each keyword in order to track. They give a number value to it. It looks now that things can’t be automated but must be done manual in case of a network who uses DirectTrack!
Any suggestions?
Yes it works with direct track.
Deploy your creative.
Then your deployed url will be like this
http://network.cpalink.com/&dlp0834&212342
well to track the &dlp0834&212342 is to track thur there system.
but to use this to tag it just replace the &dlp0834&212342 with the code. (check with you CPA network to confirm it is subid=)
http://network.cpalink.com/subid=< ? echo ( ( strlen( $k1w ) <6 ) ? “Default Text” : “$k1w\n” ) ; ?>
you will have to in your stats download optional info to get the information.
Enjoy!
Thanks CPA Affiliates!
Let see that this is my networks’s affiliate url for a certain offer:
http://nbjmp.com/click/?o=1553&a=5456&c=31548&s=358
What changes do I need to make regarding your explanation?
Thanks again!
Mike
Boy, that’s some nice code.
;)
Using YSM I have enable EasyTrack and added your specified code to my landing page. However my page is .html
How do i set the htaccess to process .html files at PHP?
Michel Z wrote :
Neil,
/%/ >> remove // then it will work!!
Which bits am I supposed to move?
Ok I removed the // and it still produced an error.
Are then any special settings I need server side?
Only thing server side is make sure it supports PHP. thats it. Sorry some of you guys are having issues with the code as it works fine for me or i wouldn’t have posted it.
How do you know the code works? I tried clicking on one of my links for Azoogle. I used
http://www.test.com/?kw={Keywordmenow}
and clicked on my affiliate link. Is there anything I’m supposed to see in URL after clicking through to ensure its tracking
dpending on the offer you are pushing to some will show it in the link others wont the easiest way is to check in azoogles subid system.
Found the solution!!!
When compying and pasting directly from this page to the dreamweaver code layout it copied Word style inverted commas - not the ” ones PHP recognises. This threw up the syntax error.
Hope this helps other users.
(Note to self always paste into notepad first!)
Great script BTW!
What Destination URL do you use for Yahoo?
Hi,
Is it possible to make an alteration to the script so that it will track across more than one page?
Thanks,
Neil
Thanks for the post - I’m looking to have something coded that will match up my masked subids from various aff networks I work with with my search marketing campaigns. You mentioned that you had one custom-coded. Any chance your developer is available? I’d go elanceish, but I cringe at the thought of writing specs for someone not familiar with the process. I’d so appreciate it if you could drop me their contact info at my email… nice blog - followed over from the elite retreat info. Guess I’ve been under a rock
I am getting the syntax error also, how did you fix this neil?
Thanks CPA Affiliates, this is a great script!
Just one thing: Does someone know how the keyword can be stored (like a cookie)? Your script works fine for me but when a website visitor close his web browser then the keyword is gone.
Regards,
Ben
[…] PHP Keyword Tracking How-To How Granular Should You Track? […]
There are few other things you might want to consider here:
- with this method you’re revealing your profitable keywords to the CPA or affiliate network, something I wouldn’t like to do.
- the sub parameter is often limited in size and will not be able to hold the entire keyword.
With PPCRiches we are offering an extremly easy keyword tracking tool - you simply send your traffic to your landing page - no need to append the keyword.
The tracking software then tells you exactly which keywords converts and what was the traffic source.
Joerg