onlineactivitybv/php-advertiserpostback

PHP Library to setup postback tracking

v2.0.3 2019-01-15 08:27 UTC

This package is not auto-updated.

Last update: 2025-03-30 08:16:27 UTC


README

PHP Library to setup postback tracking

Postback concept explained

Installation

Composer:

$ composer require onlineactivitybv/php-advertiserpostback "^2"

Requirements

PHP 7.0+, Curl

Usage

Init:

require __DIR__ . '/vendor/autoload.php';

use OnlineActivityBV\AdvertiserPostback\AdvertiserPostback; 

$oa = new AdvertiserPostback(
	 'abdddsdsdsjhdshjshj33jhhjdshjc', /* Here credentials provided by OA **/ 
     'oa6.nl', /* tracking domain, provided by OA */
     'oa_clickid' /* $_GET variable name used to send click id to lander **/); 

Landingpage:

Add this code to the TOP of your landing page (sets cookie so needs to be before any other output.

$oa->landingPage(); 

Thank you page:

Save OA ClickId to your database and link to conversion

$clickId = $oa->getClickId(); 

With ClickID you can either choose to run postback on thank you page or you can call the postback on a later moment, with the clickId extracted from your database.

// first outout thank you HTML.
fastcgi_finish_request(); // optional, recommended not to delay output of thank you HTML.
$conversionStatus = $oa->addConversion($lead_id = 376, $eventId, $clickId);