Setting up tracking for Facebook campaigns is not very difficult since we do not need to track any keywords. All we want to do is make sure each ad has a different subID so we can easily tell how much money each ad is generating.
About one month ago I posted a bit about this however thanks to a bit of PHP I now use a much more efficient way of doing that does not require me to make a new web page for every ad.
To demonstrate I will be using an aff link from Neverblue ads. Basically what we are going to do is set the sub ID to a PHP variable that we can change by simply editing the destination URL of our page.
Let’s say you are sending people to www.somerandomsite.com when they click on your Facebook ad. What we are going to do is use PHP so that we can dynamically insert a subID.
Step 1: Instead of linking to www.somerandomsite.com you will link to www.somerandomsite.com/index.php?sub=yourSubHere. You can replace “yourSubHere” with anything you want. So each time you make a new ad just change “œyourSubHere” to something new to represent that ad.
Step 2: Now we need to open index.php and add a little bit of PHP so that the subID you put into the page URL above will show up in the affiliate link that people click on. Open your landing page in your favorite text editor and ad the following code at the very top of the page (even before the <html> tag):
<?php
$sub = $_GET['sub'];
$affLink = “http://hjlas.com/click/?s=26467&c=82445&subid=$sub”;
?>
If you do not know anything about php all this does is $_GET["sub"] will get that value that you assigned to sub in your URL (sub=youSubHere as shown above) and it will store it in $sub. So now anytime we refer to $sub it will hold yourSubHere.
Now simply make $affLink equal to your own affiliate link (right now it’s equal to one of mine) but make sure you do not change “subid=$sub” as this is what will store your subIds.
Step 3: Almost done! The last step is just to switch your affiliate links in your website to the affiliate link with dynamic subIDs that we just created in step two. Where ever you aff link is on your page replace it with <? php echo “$affLink”; ?> .
For example
<a href=” http://hjlas.com/click/?s=26467&c=82445&subid=1″> Click Here</a>
Would become:
<a href=”<? php echo “$affLink”; ?> “>Click Here</a>
That’s all there is too it, now you can easily create new subIDs for every ad. Hopefully this was not to confusing for those of you that do not know PHP. If it is Let me know and I’ll see if I can clarify it better, maybe make a video or something.








Hey, My name is Neil Turner and my goal is to be a super affiliate! At my blog I will be sharing everything that I learn on route to achieving this ultimate goal. Sign up to my rss feed and join me on my exciting journey to affiliate stardom! My journey into the world of affiliate marketing was full of twists and turns. The following is a quick overview of how I got
I dumb it down even further. I split test one ad per offer at a time. And usually only one per day. I direct link and just let the affiliate network do all the tracking. Their click count is always within like 10 clicks of what facebook says.
Saves me 10 minutes of coding so ha!