User Tools

Site Tools


merkalt:simple_ads_tracking_system

SIMPLE TRACKING SYSTEM

// Tracking performance of ads.

Should work like this: Each time it is a conversion from the X ad an counter should increase by one. The date and time for the sale should also be saved. In admin it should be a simple overview of each of the ads performance for today, yesterday, this week, this month, last month. //

Affiliate sales tracking build on extraction of affiliate identifier from affiliate referrer link and saving it in session variables. The process includes several parts which are the following:

1. Link on affiliate’s website, which contains ad's identifier.

Ad X will link to merkalt with for example URL http://www.merkalt.no/side.php?ad_id=[ad_id] (ad_id = identifier of ad in the db - eg. 5)

Ads tracking works ONLY for root instance of merkalt.no site.

2. Affiliate ID extraction from requested page name. Obviously, there is no such page http://www.merkalt.no/side.php?ad_id=[ad_id] on merchant server. The request will be redirected on another existing page (for instance, index.php), initially requested page name will be parsed and affiliate ID and ad ID will be added as a parameter to index.php request. This will be done with a help of adding mod_rewrite module instructions in .htaccess file on merchant server (mod_rewrite module should be allowed on merchant server). These instructions are:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule side\.php index.php?%{QUERY_STRING}&affiliate_id=1 [L]

Anyway, the link will contain two parameters: affiliate ID and ad ID. Both of these parameters should be saved in user session on index page.

3. Completed sales tracking. If customer purchases some product on merchant’s web site, on payment completion, affiliate ID and order data will be sent on tracking script for transaction registration. Order data includes unique order ID and order total sum. Tracking code (which sends needed data on tracking script) should be placed on “thank you” page that appears to customer when order is made completely. Tracking code is a JavaScript which could be placed in page header:

Here: affiliate_id – affiliate ID from customer session variables, order_id – order unique identifier, order_total – order total sum, analitics_url – URL of the script which performs transaction registration.

File ad_track.js should be placed on merchant server and should be accessible from “thank you” page.

Tracking code for this tracking system will be built-in as a part of existing schema of plugging of affiliate systems on merkalt.no (like as euroads, affiliate pro, etc.). This task will include:
a) creation of template for this system;
b) creation of affiliate class for this system (in affiliation/ folder);
c) creation and setting up of section in settings.inc.php file (root instance only);

Administrator section of tracking system

1. Main menu in admin section include only two options: sales report and affiliate accounts list. Sales report should be set as default page.

2. Affiliate accounts list should contain only one affiliate record with ID = 1. Functionality of affiliate accounts management page should be kept as is.

3. Ads management - ads list with 20 ads will be pre-defined in database with default description being Ad 1, … , Ad X

4. Sales report -
a) selector of the reporting period should be implemented for this report. It could be realized like a group of select controls + 'Apply' button. First three select controls allows to select day, month and year for the start date of report. Next three controls allows to select day, month and year for the end date of report. Selected options should be saved in cookies on 'Apply' button click and should be restored on the next page visit as default. If no selection has been made yet, current date should be set as default selection for both of dates;
b) listing table include only 'Ad ID', 'Ad description' and 'Number of sales' columns;
c) sales report contain a list of ads which have recorded sales for the selected reporting period. The number of sales for each ad should be shown in 'Number of sales' column;
e) total number of sales in the bottom of ads list;
f) pagination links set;
g) ad search function - by ID and description;

merkalt/simple_ads_tracking_system.txt · Last modified: by dmitriy