You are here: Home > Forum > General Affiliate Forum > Tracking PPC keywords to the point of sale Goto page Previous  1, 2 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: Wed Feb 08, 2006 7:35 pm    Post subject: Reply with quote

Jim,

I won't to make sure that I have this correct. Please let me know if anything I am stating below is wrong.

1. I will need to set this script on my landing page (the immediate page that the visitor lands on once they have clicked on one of my PPC ads)

Code:
<?php session_start();
@include("./scripts/tracking.php");
setcookie("tracking", $tracking, time()+60*60*24*30;
$_SESSION["tracking"] = $tracking;
?>


Will I also have to implement the settings on the htaccess file as you spoke of earlier in order for this script to work on an .html or .htm page?

2. Next, I will be setting a link on the landing page that will go to the redirect page. (NOTE: I only do this extra step because I like to track actions on clicks from visitors through my adtracker)

3. Once on the redirect page, which will have a .php extension, I will setup the page like so:

Code:
<head>meta http-equiv="refresh" content="1;url=http://www.tkqlhce.com/click-1783099-10368932<php echo $tracking;?>

<?php include("./scripts/tracking.php");?>"

</head>


4. The visitor will then be sent to my merchant's website with the appended values at the end of the sales ID within the address bar.
Example: http://www.tkqlhce.com/click-1783099-10368932?sid=search=goog&keyword=online+gaming

This is how I intend to set everything up.......does this look ok to you?
Back to top
Jim Hutchinson
Moderator


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

PostPosted: Wed Feb 08, 2006 8:24 pm    Post subject: Reply with quote

John

Everythng looks good except 2 things:
1) Put the <?php include("./scripts/tracking.php");?> BEFORE the meta refresh. Otherwise it won't contain the tracking data.
2) Remove the quote after the include line: <?php include("./scripts/tracking.php");?>" I realize this was probably just a typo.

Other than that, you're good to go. You're doing great!

Jim
Back to top
grafx77



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

PostPosted: Wed Feb 08, 2006 11:44 pm    Post subject: Reply with quote

Hello Jim

I will make the adjustments you described and let you know how things go today. Thanks for your help and for the script. You are a SAINT!

If you ever need anything......send me a PM. I would be glad to help.

John
Back to top
grafx77



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

PostPosted: Thu Feb 09, 2006 1:32 am    Post subject: Reply with quote

Hello Jim,

Tested out the script and didn't seem to get too far with it. First off, when I upload the .htaccess file, my complete website doesn't show up. I get an " HTTP 500 Internal Server Error", so I removed it and my website shows up again.

So I decided to go ahead and make my landing page a .php page for the sake of testing out the rest of the script. I inserted the cookie code on my reviews page and I get a "Parse error: parse error, unexpected ';' in /home/giftgadg/public_html/movierentalclubguide/reviews.php on line 5
" message.

I have copied and pasted the top portion of my landing page here:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<?php session_start();
@include("./scripts/tracking.php");
setcookie("tracking", $tracking, time()+60*60*24*30;
$_SESSION["tracking"] = $tracking;
?>
<html><!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Online Movie Rental Clubs - Which Rental Club is right for you?</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" href="mystyles.css" type="text/css">


Please let me know if you see anything wrong.

John
Back to top
Jim Hutchinson
Moderator


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

PostPosted: Thu Feb 09, 2006 1:46 am    Post subject: Reply with quote

I was waiting for you John. Smile

Two things are wrong. First, you must start the session before *anything* is sent to the browser, including the <!DOCTYPE.

The second problem is my mistake. I didn't close the cookie line with a right paren.)

It looks like you're using a template but you need to get into the source of the page and do the manual edits. No WYSIWYG program that I know of allows anyting before the DOCTYPE.

Here's your new code:

Code:
<?php session_start();
@include("./scripts/tracking.php");
setcookie("tracking", $tracking, time()+60*60*24*30);
$_SESSION["tracking"] = $tracking;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Online Movie Rental Clubs - Which Rental Club is right for you?</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link rel="stylesheet" href="mystyles.css" type="text/css">


Hope that helps.

Jim
Back to top
grafx77



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

PostPosted: Thu Feb 09, 2006 3:58 am    Post subject: Reply with quote

Hello Jim,

Troubles in paradise again. Wink

First off, my page with the cookie script now shows up, but I couldn't find any cookies stored on my browser for that page.

Secondly, I uploaded the tracking.php script and setup everything on my redirect page according to how you stated earlier, but I get this message now: Warning: main(./scripts/tracking.php): failed to open stream: No such file or directory in /home/giftgadg/public_html/movierentalclubguide/dvdavenue.php on line 6.

Here are the steps I take:
1. Go to http://movierentalclubguide.com/reviews.php
This is my landing page.

2. Click on the DVD Avenue title or picture toward the middle of this page.
3. You will then get the error message I described earlier.
4. I know you won't be able to view the source code, so here is the top portion.
Note: line 6 is the php include. Its stating there is an error there.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>MovieRentalClubGuide Direct to DVD Avenue</title>
<?php include("./scripts/tracking.php");?>
<meta http-equiv="refresh" content="1;url="http://www.jdoqocy.com/click-1917092-6246762<php echo $tracking;?>">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
Back to top
Jim Hutchinson
Moderator


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

PostPosted: Thu Feb 09, 2006 4:42 am    Post subject: Reply with quote

John

I see where the error is: The redirect line has a quote in the wrong place. Remove the " from url=" because what it does there is end the link. That line should look like: <meta http-equiv="refresh" content="1;url=http://www.jdoqocy.com/click-1917092-6246762<php echo $tracking;?>">

Also, I don't see the session being started even though the server's adding PHPSESSID on each of your other links. Although not absolutely necessary, it would help to include the tracking file at the top immediately following the session_start() tag. Then redirect in the header as you're doing now.

I forgot tomention earlier about the .htaccess file. Your host could have the option for modifying behavior disabled. That would explain why you cannot parse HTML files like PHP.

Jim
Back to top
grafx77



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

PostPosted: Thu Feb 09, 2006 5:37 am    Post subject: Reply with quote

Hello Jim,

Almost there!

1. Now my redirect page is actually redirecting to the correct affiliate, but the error message that I posted in my last thread still comes up 3 times.
Its still stating that there is an error on line 6. Line 6 includes this code:
<?php include("./scripts/tracking.php");?> . I have a feeling something is wrong there.

2. I see that the session ID is recording, but I don't see a cookie being stored on my browser when going to the reviews.php page (landing page).
Do you think the script is working properly? Shouldn't there be a cookie stored?

John
Back to top
Jim Hutchinson
Moderator


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

PostPosted: Thu Feb 09, 2006 6:12 am    Post subject: Reply with quote

Hi John

The code works perfectly on the sample page, so this is confusing. However, according to the PHP manual, cookies must be set BEFORE any output is sent to the browser, including any HTML or HEAD settings. What that means is you need to start the session, include the tracking file, then set the cookie. After that you can start the DOCTYPE, HEAD, etc.

Also, in tracking.php, next to the bottom line is: return $tracking;
Either remove the line or preface it with // (2 forward slashes indicate a comment. So the line will look like this: //return $tracking;

I sent you email since the PM function here is disabled but the email bounced. If the edits here don't fix it, let's speed things up a bit. Go to my site, use the contact form to send me your phone number and I'll call you tomorrow. Let me know when a good time is. It's now after midnight here (Central)

Jim
Back to top
grafx77



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

PostPosted: Thu Feb 09, 2006 6:30 pm    Post subject: Reply with quote

Hello Jim,

I couldn't agree with you more in regards to calling me about this. There are a few things that are still not working correctly. I am going to send you an email via contact form on your website.

John
Back to top
grafx77



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

PostPosted: Thu Feb 09, 2006 6:36 pm    Post subject: Reply with quote

Jim,

I just tried contacting you on your contact form within your website, but once submitted, the following page came up with a few .php errors, so I dont think my message got sent.

I have my MSN messenger up and running. If you would like, you can message me at grafx771 at cox.net on MSN messenger and we can go from there. That is also my main emaill address.

thank you,
John
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 Previous  1, 2
Page 2 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