Why is my redirect passing through ppc search terms?

Truffles

New member
Apr 20, 2009
333
3
0
I have a campaign I just launched and I am doing some keyword testing by direct linking via AdCenter. To hide the keywords from my merchant, I set the destination URL to a redirect page on my domain that then sends them through to the SaS tracking link.

So the ad setup is:
Display URL: Merchants domain (on some ads I actually use my domain even though I am direct linking and MS hasn't flagged it yet but that shouldn't affect anything)
Destination URL: mydomain.com/recommended.php that then redirects to the merchants domain via SaS tracking link

The code for recommended.php is as follows:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Recommended</title>
</head>


<body>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXX-9");
pageTracker._trackPageview();
} catch(err) {}</script>


<?php
header("location:http://shareasaletrackinglink.html");
exit;
?>
</body>
</html>
So what's the problem? Well, I just got my first conversion today and not only did the conversion not track in AdCenter (the merchant confirmed they had placed my code...), but in the SaS details for the "Page Banner was Clicked From" field it gives the entire Bing URL (including the long tail term that drove the conversion) instead of mydomain.com/recommended.php. This is bad news because this long tail term is now visible to my merchant--joy.

Am I just an idiot when it comes to making PHP redirects and coded it incorrectly? Is there something inherent in the function I used to redirect that would make the referrer whatever brought them to my recommended.php page instead of my redirect page? What am I doing wrong here?
 


It's a crazy guess, but my thought would be that PHP, being server side isn't being seen on the otherside. You might want to try a client side redirect.

Code:
<META 
http-equiv="refresh" 
content="1;URL=http://yoururl.tld">
</head>
 
Frankly I'm amazed that works at all.

Usually, you have to use the PHP header: location stuff at the very top of the file, before any HTML is sent to the browser. Secondly, a PHP redirect will not hide anything. You need to use a meta refresh as stated above.
 
Ok, so in my redirect file if I replace:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Recommended</title>
</head>

with:

<META http-equiv="refresh" content="1;URL=http://yoururl.tld">
</head>
then that should do it? How would I go about placing my Google Analytics code in this situation? Should I have a redirect like I have now and instead of having the URL go to the SaS tracking link, have it instead go to another redirect page that uses the meta refresh mcvader suggested? It looks like that might work but seems overly convoluted for what I am trying to accomplish which is the following:


  1. Track the pageview via Google Analytics so I can include it as part of a conversion funnel
  2. Hide my direct linking keywords from my PPC efforts so it only passes through my domain as the referrer
  3. Redirect the visitor to my SaS tracking link.
 
No, don't replace it, just add it before </head>

It's not overly convoluted, you're simply replacing a php redirect with an HTML redirect which is more likely to be seen by the browser.
 
Ok, so my header code would look like:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META http-equiv="refresh" content="1;URL=http://yoururl.tld">
<title>Recommended</title>
</head>
Now how would I incorporate Google Analytics into this?
 
Ok, so my header code would look like:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META http-equiv="refresh" content="1;URL=http://yoururl.tld">
<title>Recommended</title>
</head>
Now how would I incorporate Google Analytics into this?
Why would you incorporate google analytics into this?
Use a tracking platform that's meant for what you're doing...
 
I'm actually trying to figure out why he's using GA on a page that's nothing but a redirect...track the page people are going to land on if you're just passing them from one page to another..
 
Why would you incorporate google analytics into this?
Use a tracking platform that's meant for what you're doing...

Would you suggest Prosper 202 for direct linking campaigns? I had never used it before and wasn't sure if it would mask my PPC keywords effectively.

The reason I had GA on there in the first place was because this jump page is also used on a pre-sell page on my site that I've been testing against and it was how I tracked outbound clicks on my affiliate links on that page.
 
Would you suggest Prosper 202 for direct linking campaigns? I had never used it before and wasn't sure if it would mask my PPC keywords effectively.
It may not by default, but Google Analytics isn't by default either. Push it through an SSL redirect where the keyword is not in the redirect and that shit should mask it in most cases iirc.
The reason I had GA on there in the first place was because this jump page is also used on a pre-sell page on my site that I've been testing against and it was how I tracked outbound clicks on my affiliate links on that page.
I think GA can keep track of clicks from the LP without being a part of the redirect. Part of the problem here is that Google's analytics software is a decent sized javascript, and you're including it on a redirect no one should see.
 
It may not by default, but Google Analytics isn't by default either. Push it through an SSL redirect where the keyword is not in the redirect and that shit should mask it in most cases iirc.

I think GA can keep track of clicks from the LP without being a part of the redirect. Part of the problem here is that Google's analytics software is a decent sized javascript, and you're including it on a redirect no one should see.

Do I need to go the SSL route or would just a htaccess rewrite mask it?

I know you can trigger a pageview by tagging a link on a page without needing it to go to another page--this was just the easiest way I could think of at the time. I do see your point though about the Javascript and its impact on load times.
 
Hey xmcp123 good to see you back, when are you updating your blog?