Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP PostBack Tracking 1

Status
Not open for further replies.

Doctarain

Technical User
Jun 2, 2006
27
US
I recently setup an account with neverblue tracking ( for a client. They started with a pixil which was easy enough but now they need me to setup a class so I can use their PostBack tracking. The image I get is that it is pretty straight forawrd, but I am not sure if they understand i am not a php wiz. I was hoping to get some insight. Thanks all

My Landing Page :
The info they send me :

Basically all you need to do is:
1. Send me the IP address of your server.
2. Use the sample php.class I sent you, modify it for your campaign as explained in the pdf document and in the php document itself and implement it in the php code of your conversion page.
e.g. this the class already modified for your offer:

<?php

require_once 'class.postback.php';

$nbpostback = new Postback( 'fb3c8f16d1f33f76198d1471dd6f05e697d8b115' );

$offer = 5656; // this is the Neverblue ID for your offer
$action = 7437; // this is the Neverblue ID for the associated action
$click_info = $_REQUEST[ 'code' ];

$response = $error = null;
if ( !$nbpostback->callPostback( $offer, $action, $click_info, $response, $error ) )
{
// log $error message and postback data
$nbpostback->logFailure( $offer, $action, $click_info, $error );
}

?>
 
looks simple enough. what's your question?
 
hehe.. ya know I looked back over the post and realize it sounds kinda stupid...

I just don't see all the angles. v.v

Issues:
1. I plug the code into existing php -> it spits out trash
2. As a stand-alone inside the html portion -> Trash
3. its a conversion page so I cannot "really" test it without running a card through the code. I don't even know if the errors are a bad thing.
4. I really hate being the 3rd party trying to piece this together.

Questions:
1.Is there a correct place to insert the code so it doesn't muddy the water...
2. could I be doing it right and the errors are supposed to be there because the i am not triggering the page open with the right url?

Gah!
 
is this just click tracking? assuming so there are a number of routes

1. create an image on your page with a single pixel in dimension. give the image src the value 'clicktrack.php'. save the scriptlet you posted above as clicktrack.php and make sure that class.postback.php is in the same directory. ideally you should then, at the end of the script, serve a transparent image with appropriate headers
Code:
header('content-type: image/png');
readfile ('path/to/pixel.png');
exit();

2. save the scriptlet in a file in the same directory as class.postback.php and then edit your php.ini file. set the auto_prepend directive to point to the file in which the scriptlet is found. restart the web server.

3. as for 2 but instead of editing php.ini edit every one of your pages that you want to track and add this to the start of the code
Code:
include 'path/to/scriptlet.php';
 
Pixel works just fine.

The trick is that the company wants to have it set so that it tracks the number of ppl that land on the page with php which I am guessing is a rather expensive way to get an extra 2%.

At any rate, I appreciate the info and the time. ^.^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top