How To Track Your Keywords With PHP & SUBID’s

October 14, 2009 by: admin

Who’s the guest?

Dan Walker has guest posted here a while back with his tutorial on htaccess tips and tricks. He was out of the affiliate game for a while but he’s just jumped back in, check out dans blog to see what he’s up to!

Hey Guys!

Hey again, good to be back, I love this blog =] Today we’re going to look at something a little technical again as that’s my field, but it’s fantastic when used properly and can really help you tweak your campaigns.

Getting comfortable with SUBID’s

Hopefully most of you know how subid’s work and how useful they are, for those of you who don’t here’s a quick runthrough. At your affiliate network (my favorite is Azoogle, so we’ll use them for our examples), you can see how many clicks, actions and often an eCPC with some other various data for each of your offers. With subid tracking we can make that information a bit more useful, for example we could add;

  • What keywords sent the click
  • Which search engine displayed the ad
  • Which ad was displayed
  • And more…

For our example we’re going to pretend we have a landing page about halloween costumes. You’ve setup PPC campaigns with Google and Yahoo with various keywords that point to your landing page. Once on your landing page, you pre-sell to users and then send them on their way to your Azoogle affiliate link. Azoogle registers your click and then if the user completes a sale, Azoogle registers an action and you get paid. We all know this.

Now, wouldn’t it be cool if Azoogle could tell you what we talked about above? It can! Normally by default, you don’t pass a subid to Azoogle, so you just get the bog standard information. If we add more information, it’ll show up. Knowing this, let’s use it to track some of our keywords!

When someone clicks your ad, you can use dynamic tags in the link. What I mean by this is if your URL contains {keyword}, it will be replaced with whatever keywords brought up your ad. So if the user searched for ‘cheap halloween costumes’ then the url would go from this;

http://www.somelandingpage.com/?keywords={keyword}
to this
http://www.somelandingpage.com/?keywords=cheap%20halloween%20costumes

Awesome! So to set something like this up, we’d enter an URL like this in Yahoo SM;

Yahoo

Great, now our landing page gets our keywords. Now with a bit of PHP wizardry, we can pass these keywords to our network as subid’s and have them show up in our network reports – let’s crack on!

The PHP Part

I’m assuming a little PHP knowledge here, if you have none though you should be able to follow along. Our keywords should now be stored in $_GET['keywords']. Now we’re going to put the keywords in our affiliate link so they get passed to the network.

It’s important to know that each network handles subid’s differently, for this post I’ll be using Azoogle, they handle their subid’s like this;

http://x.azjmp.com/12345?sub=subidgoeshere

That link above is your affiliate link, with the subid ‘subidgoeshere‘. Now thanks to the wonderful PHP, we can create this URL when the page loads, and append the keywords to the subid. At the top of your landing page (the file extension should be pagename.php) put this code;

<?PHP $subid = urlencode($_GET['keywords']); ?>

This code puts the keywords in a variable called $subid and makes it a little more secure. Now secondly, you want to replace all of your outbound affiliate links with this code;

<?PHP echo “http://x.azjmp.com/12345?sub=” . $subid; ?>

Obviously, replace the affiliate link with your own and this will print out your affiliate link with the keywords appended as a subid. Now when you check your reports at your network you should be able to track by keyword. Make sure you turn on subid’s in your reports, in Azoogle you do this by pressing “Show Search Criteria” and clicking subid’s.

Conclusion

I haven’t wrote tutorials in quite a while, but hopefully you’ll enjoy this one. If you found this one useful, let me know via the comments below and I’ll follow up with a part two on how to make the URL’s look a lot prettier and some other tips and tricks!

If you have any questions, again please comment below and I’ll try my best to reply as soon as I can!

Dan


Related posts:

  1. Targeting Multiple Keywords vs. Singular Keyword Focus
  2. How To Track Referrals With Aweber
  3. 3 Steps for Optimizing Content for Long Tail Keywords
  4. Keyword Targeting: How to Employ Multiple Keywords for SEO & Conversions
  5. Some Keywords in AdWords Ads Diagnostic Tool Require Content Network?
  6. Yahoo’s Senior Director of Search Got It Wrong, Yahoo Uses Meta Keywords Still
  7. Google Webmaster Tools Keywords Report Showing Blank Lines?
  8. Simple keyword conversion tracking
  9. How to Choose the Best Keywords for Optimized Public Relations
  10. Options to Track Your 404 Errors
  11. Finding long tail keywords.
  12. Do you have the right keywords?

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Comments

One Response to “How To Track Your Keywords With PHP & SUBID’s”

Leave a Reply