You are here: Home > Forum > General Affiliate Forum > Tracking PPC keywords to the point of sale Goto page 1, 2  Next Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Tue Feb 07, 2006 1:47 am    Post subject: Tracking PPC keywords to the point of sale Reply with quote

Ok....for all you tracking junkies who track everything on your website, keywords and signups......here is a question for you. This maybe over a few peoples head, but I will ask anyway.

For the time being, there is no real way of tracking PPC keywords to the point of sale on merchant websites without a remote tracking script, which most adtracking programs offer these days.

There is another way of tracking sales within affiliate networks such as CJ.com, Linkshare, and Performics from keywords that brought the visitor to that sale/signup. Its called Sales ID or Member IDs. These IDs are added to the end of your affiliate link so that anything that gets appended to the end of your link will show up within the affiliate network reports once a sale is made. CJ's Sales ID is ?sid= and Performics is ?mid=.

The key here is to have your tracking url (http://yourwebsite.com/?search=goog&keyword=online+gaming) dynamically append to the end of your affiliate link sales ID once clicked by your visitor. The link will then be added to the end of the Sales ID string (?sid=). Once the tracking URL is added to the end of the sales id, CJ and other affiliate networks will report the tracking URL along with any sale made under their reports section.

Now for anyone who has followed my explanation thus so far, I have a question for you. Does anyone know of a script or program that will append the tracking URL to the end of my affiliate links dynamically? I will hire a programmer to do this for me if noone else has any further answers.

Anyone have any other methods of tracking your PPC keywords to the point of sale?

Regards,
John
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Tue Feb 07, 2006 4:31 am    Post subject: Reply with quote

Hello John

I put together a script that you might be able to use. It will look for the keyword search terms used in CJ.com, Performics, Yahoo! and Google. You can easily add more too.

Click Here to test it. Let me know if it's what you want.

Jim
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Tue Feb 07, 2006 5:50 am    Post subject: Reply with quote

Hello WebsiteMangers,

I think this script may be exactly what I have been needing. I do have a few inquiries though as to how it works.

1. Will this code append all parameters that I set within my tracking URLs from Google, Overture, etc (Ex. Keywords, Search Engine, Date, etc)

2. What do I have to edit on this script in order for it to work or do I edit it at all?

3. What happens if my visitor clicks on my google tracking url and reaches my reviews page. Once there, they click on a few other pages within my website and the back to the reviews page in which they click on my CJ affiliate link. Will the script still append the parameters from the tracking URL?

4. Why is the MSN keywords and Yahoo keywords set within the scipt? I see that CJ and Performics are there, but what are the "q" and "p" string there for on yahoo and msn?

5. Would you save this script to your home directory or make a folder named includes and put it in there?

Seems like this would work, but doesn't have much instructions for someone like me with no programming experience to follow. Hope to hear back from ya and thank you for you help.

John
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Tue Feb 07, 2006 1:27 pm    Post subject: Reply with quote

grafx77 wrote:

1. Will this code append all parameters that I set within my tracking URLs from Google, Overture, etc (Ex. Keywords, Search Engine, Date, etc)

You need to tell the script which information you want to track by adding new sections to the list. That's as easy as copying and pasting an existing section and changing the key.

grafx77 wrote:

2. What do I have to edit on this script in order for it to work or do I edit it at all?

See above.

grafx77 wrote:

3. What happens if my visitor clicks on my google tracking url and reaches my reviews page. Once there, they click on a few other pages within my website and the back to the reviews page in which they click on my CJ affiliate link. Will the script still append the parameters from the tracking URL?

You can store the parameters in sessions then add them to your CJ link. Sessions are pretty easy to implement but if you have multiple pages that your visitors can browse, you'll need to use the sessions in each page. Otherwise, your tracking can be lost if they go to another page before clicking your CJ link.

grafx77 wrote:

4. Why is the MSN keywords and Yahoo keywords set within the scipt? I see that CJ and Performics are there, but what are the "q" and "p" string there for on yahoo and msn?

I put them there because some traffic can come from those sites.

grafx77 wrote:

5. Would you save this script to your home directory or make a folder named includes and put it in there?

That's a matter of personal preference. Whatever is easiest for you to link to.

grafx77 wrote:

Seems like this would work, but doesn't have much instructions for someone like me with no programming experience to follow.

The instructions you need to include the file in your page and create your links are inside the tracking.php file.

You must use a text editor to edit that file. Do not use FrontPage or other program that adds its own code. DreamWaever MX should be OK though. Best bet is Note Tab. It's what I use for scripting and building websites. There's a free version at http://www.notetab.com

I have not completely testing this script in all environments, since I just basically through it together afer seeing your original request. So you'll need to know how to manually create links, copy & paste and follow the sample in the file. If it's not quite right for you, then maybe there's another solution someplace that's easier, or you could have someone help you set it up with all the sites you want to track links from.

Jim
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Tue Feb 07, 2006 8:30 pm    Post subject: Reply with quote

Jim,

Thank you so much for your help and guidance with this script. There are only a few simple questions I have left pertaining to this below:

1. Once I save the posted script as a tracking.php, I would need to implement the code "<?php include("./scripts/tracking.php");?>" into the head of my landing page and use "<?php echo $tracking;?>" at the end of my affiliate url? Example: <a href="http://your-site.com/clicksrv_id=12345?sid=<?php echo $tracking;?>"

2. This may be a dumb question, but does my landing page have to be in a .php extension in order for this to work? If so, is there any workaround to this?

3. Do you know where I could get information to store parameters in sessions? Is this the same as stating that I need to store the paramaters within a cookie for each visitor?

Thank you so much for your guidance on this issue. This means alot to me and will definately help out my tracking efforts.

John
3.
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Tue Feb 07, 2006 9:00 pm    Post subject: Reply with quote

grafx77 wrote:
1. Once I save the posted script as a tracking.php, I would need to implement the code "<?php include("./scripts/tracking.php");?>" into the head of my landing page and use "<?php echo $tracking;?>" at the end of my affiliate url? Example: <a href="http://your-site.com/clicksrv_id=12345?sid=<?php echo $tracking;?>"

That's almost correct. You won't put the ?sid= in the link because the script does that. Your link will be <a href="http://your-site.com/clicksrv_id=12345<?php echo $tracking;?>"> If you want to use sid= instead of the 'key=' that the script uses, change it in this line:
$tracking = $char."key=".urlencode($keyword); I chose 'key=' because that way it won't interfere with the incoming links that use 'sid'.

grafx77 wrote:
2. This may be a dumb question, but does my landing page have to be in a .php extension in order for this to work? If so, is there any workaround to this?

Although that's the best method, there is a way around it. You can tell the server to treat HTML files as PHP by putting a single line into a file called .htaccess in your public folder. That line is:
AddType application/x-httpd-php .htm .html

Since Windows might complain about not having anithng before the dot, name the file htaccess.txt. Then after uploading it to the server, rename it to .htaccess. But first check to see if there's already a file on the server with that name. If there is, download it, then add that line to the top. Once done, all your .html and .htm files will be treated as .php files.

grafx77 wrote:
3. Do you know where I could get information to store parameters in sessions? Is this the same as stating that I need to store the paramaters within a cookie for each visitor?

Cookies are a good alternative to sessions. In fact, sessions use cookies by default, but we won't get into the technical details here. I searched Google for PHP sessions for beginners and see that there are some good tutorials.
grafx77 wrote:
Thank you so much for your guidance on this issue. This means alot to me and will definately help out my tracking efforts.

You're very welcome. Let me know if you need further assistance with this.

Jim
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Tue Feb 07, 2006 10:01 pm    Post subject: Reply with quote

Jim,

Thank you again for your help. Just to reinerate.

1. The ENTIRE tracking.php script needs to be saved. Including the <?php include("./scripts/tracking.php");?>" part and the <php echo $tracking;?> part within the trackin.php file? Then, I would use also use the <php echo $tracking;?> and <?php include("./scripts/tracking.php");?> string on the landing pages as well?

2. When using the .htaccess method you described in your last thread, .html or .htm extensions will be treated as .php pages. Couldn't I also use a link on my landing page that takes the visitor to a page with the a meta redirect code (meta http-equiv="refresh" content="1;url=) on it and save the page as .php.

The meta redirect code would then look like this (meta http-equiv="refresh" content="1;url=<php echo $tracking;?> ) and the page would of coarse also contain the include "<?php include("./scripts/tracking.php");?>" within it.

This scenario would only work with the visitors sessions being tracked, but I need to enable this anyways because my visitors will have the ability to click on other links. What do you think of this scenario?

3. Thank you for the link. I will read up on the sessions and hopefully get that to work. Hopefully the tutorials are easy to follow.

Thank you for your time,
John

3.
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Tue Feb 07, 2006 10:24 pm    Post subject: Reply with quote

grafx77 wrote:
1. The ENTIRE tracking.php script needs to be saved. Including the <?php include("./scripts/tracking.php");?>" part and the <php echo $tracking;?> part within the trackin.php file? Then, I would use also use the <php echo $tracking;?> and <?php include("./scripts/tracking.php");?> string on the landing pages as well?

Correct.

grafx77 wrote:
Couldn't I also use a link on my landing page that takes the visitor to a page with the a meta redirect code (meta http-equiv="refresh" content="1;url=) on it and save the page as .php.

That looks good in theory, but how are you going to transfer the tracking codes from the HTML page to the PHP page without using PHP? There may be a JavaScript function to help with that, but I'm not real fluant with that type of scripting. Maybe someone else on the forum is?

grafx77 wrote:
The meta redirect code would then look like this (meta http-equiv="refresh" content="1;url=<php echo $tracking;?> ) and the page would of coarse also contain the include "<?php include("./scripts/tracking.php");?>" within it.

YOu need to include a page name between url= and <?php echo otherwise all you'll be trying to pass is the tracking codes.

grafx77 wrote:
This scenario would only work with the visitors sessions being tracked, but I need to enable this anyways because my visitors will have the ability to click on other links. What do you think of this scenario?

I like it and sessions/cookies are a good way to go. You're on the right track to enhance your monitoring.

Jim

_________________
How's Your Credit?
http://FICOtraining.com
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Tue Feb 07, 2006 11:34 pm    Post subject: Reply with quote

Hello Jim,

We meet again. Just wanted to clarify what I had wrote earlier to you to see if this whole system will work for what I need it for.


Quote:
That looks good in theory, but how are you going to transfer the tracking codes from the HTML page to the PHP page without using PHP? There may be a JavaScript function to help with that, but I'm not real fluant with that type of scripting. Maybe someone else on the forum is?


I plan to transfer the tracking code to the .php page by using the session cookies as you explained earlier. You stated that the tracking code would still append if sessions were enabled, correct? This scenario would only work when I enable sessions for each of my visitors.

Quote:
YOu need to include a page name between url= and <?php echo otherwise all you'll be trying to pass is the tracking codes.


Sorry this was a typo on my part. What I meant was that the redirect page would look like this (meta http-equiv="refresh" content="1;url=http://www.myaffiliatewebsiteurl.com?memberID=1234-3456<php echo $tracking;?> ) and the page would of coarse also contain the include "<?php include("./scripts/tracking.php");?>" within the <head> tags.

So what do ya think? Along with sessions/cookies for my visitors, do you think the above will work on the .php redirect page.

Also, will the session/cookies script interfere or work with the script you provided me?

Thanks so much,
John
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Wed Feb 08, 2006 12:38 am    Post subject: Reply with quote

Jim,

Just reviewed over the links pertaining to cookies you sent me. The tutorials seemed simple enough to follow on how to set cookies, but couldn't find anything on how to pass the parameters of the tracking code to your code. Any suggestions?

John
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Wed Feb 08, 2006 1:36 am    Post subject: Reply with quote

I don't know that you have any control over how the PPC's pass the parameters. If they are passed, the tracking script will catch them for you. If you go to google.com and do a search for anything, look on the right for the Sponsored Listings. Hover your mouse over one of the links and look at your status bar at the bottom of the browser screen. You'll see something like, "goto somesite.com".

However, left-click one of the links and hold it while looking at the status bar. Either that or right-click and copy the shortcut, then paste it into a notepad document. What you'll see is a link with the parameters encrypted, followed by the destination URL.

The destination site's address will look something link this: someurl.com/?gclid=CNHqpZ7lh4MCFRcaIgodYkaHlA

Keep in mind that's Google's method and I have been looking for a program to decrypt it. Not knowing what it was encrypted with poses another problem.

What I recommend is looking at the strings the other PPC's use to see if they are even passed in a human-readable form. I suppose this should have started the conversation before we got so far. I'll keep looking for a clues.

Jim
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Wed Feb 08, 2006 4:41 am    Post subject: Reply with quote

Hello Jim,

Ok....ya threw me for a loop on your last reply. All PPCSE use tracking URLs for each keyword. For Google, your tracking URL would look something like this: "http://www.mywebsite.com/?search=goog&keyword=online+gaming" for the keyword online gaming. The URL "http://www.mywebsite.com/search=goog&keyword=online+gaming" would show up in the visitors browser. I would need the parameter of goog and online gaming to be appended to the end of my affiliate links.

This is what I was asking at the beginning of the thread. I am aware of left clicking on PPC ads and getting an encrytped URL, but this is not the URL that shows up once the visitor reaches your website on a particular search.

Have you by chance used the code that you offered me on PPC ads? Will the script you posted not work with PPC advertisement tracking URLS?
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Wed Feb 08, 2006 5:13 pm    Post subject: Reply with quote

Hi John

I haven't been running any PPC campaigns lately but tested the link from my first post here again. It captures the original query string and adds it onto any parameters you might put in the links.

I added the parameters 'search' and 'keyword' to capture the Google links too. Download the updated file and play with it.

Jim
Back to top
grafx77



Joined: 05 Dec 2005
Posts: 29
Location: Las Vegas

PostPosted: Wed Feb 08, 2006 5:32 pm    Post subject: Reply with quote

Thanks Jim,

I had a post yesterday that I wanted to verify with you that I think you missed yesterday. Here it is:

Hello Jim,

We meet again. Just wanted to clarify what I had wrote earlier to you to see if this whole system will work for what I need it for.


Quote:
That looks good in theory, but how are you going to transfer the tracking codes from the HTML page to the PHP page without using PHP? There may be a JavaScript function to help with that, but I'm not real fluant with that type of scripting. Maybe someone else on the forum is?




I plan to transfer the tracking code to the .php page by using the session cookies as you explained earlier. You stated that the tracking code would still append if sessions were enabled, correct? This scenario would only work when I enable sessions for each of my visitors.



Quote:
YOu need to include a page name between url= and <?php echo otherwise all you'll be trying to pass is the tracking codes.


Sorry this was a typo on my part. What I meant was that the redirect page would look like this (meta http-equiv="refresh" content="1;url=http://www.myaffiliatewebsiteurl.com?memberID=1234-3456<php echo $tracking;?> ) and the page would of coarse also contain the include "<?php include("./scripts/tracking.php");?>" within the <head> tags.

So what do ya think? Along with sessions/cookies for my visitors, do you think the above will work on the .php redirect page.

------------------------------------------------------------------------------------

Once adding enabling cookies to your script, I won't have any parameters that I need to change within your script or to the cookie? The cookie will just record the visitors tracking url automatically once set?

Thank you very much again for your help,
John
[/quote]
Back to top
Jim Hutchinson
Moderator


Joined: 17 Jan 2006
Posts: 562
Location: Iowa, USA

PostPosted: Wed Feb 08, 2006 6:34 pm    Post subject: Reply with quote

Quote:
What I meant was that the redirect page would look like this (meta http-equiv="refresh" content="1;url=http://www.myaffiliatewebsiteurl.com?memberID=1234-3456<php echo $tracking;?> ) and the page would of coarse also contain the include "<?php include("./scripts/tracking.php");?>" within the <head> tags.


Here's a sample that you can modify with your values and put into the top your page. The cookie will be set for 30 days. You'll have both cookies and sessions to track the paraqmeters. I like ot use both in case someone refuses to accept the cookies. Make sure there are no spaces above or before the <?php:
Code:

<?php session_start();
@include("./scripts/tracking.php");
setcookie("tracking", $tracking, time()+60*60*24*30;
$_SESSION["tracking"] = $tracking;
?>
<html>
<head>
[add refresh and other META data here]


Quote:
Once adding enabling cookies to your script, I won't have any parameters that I need to change within your script or to the cookie? The cookie will just record the visitors tracking url automatically once set?

Correct, unless you need to add new PPC's or alter the existing ones.

I hope we covered eveything here and realize it's confusing at first, but I think you're getting an understanding of it now.

Jim
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetProfitsToday.com Forum Index -> General Affiliate Forum All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum