Configuration File

Navigation: constants-user.php file located on your Server, in the lib folder of your CPV Lab Pro install

  • Starting in CPV Lab Pro v. 6.0 we have introduced a Visual Editor for the Configuration Settings which means you don't need to edit this settings directly in the file as described below.

  • For older CPV Lab Pro versions, please use the guide below when editing the settings.

Options for Advanced Users

  • In order to improve the speed of redirects between campaign pages and to offer more customizable options, we added a new configuration file where you can manually edit several CPV Lab Pro settings that don’t require frequent changes.
  • These are global settings that affect all campaigns and most likely you won’t have to change them again after defining them once. Or you can just use the default values.
  • Configuration options can be used to control the look and behavior of CPV Lab Pro.
  • These options can be modified by editing or adding lines in the constants-user.php file inside the lib folder.
  • The default values defined in this file look like described below:
	$GLOBALS['DateFormat'] = "m/d/Y g:i A";
	$GLOBALS['DateShortFormat'] = "m/d/Y";
	$GLOBALS['ThousandsSeparatorCSV'] = "";
	$GLOBALS['DecimalSeparatorCSV'] = ".";
	$GLOBALS['CookieTimeout'] = 2592000;
	$GLOBALS['BasePhpPage'] = "base.php";
	$GLOBALS['Base2PhpPage'] = "base2.php";
	$GLOBALS['Base3PhpPage'] = "base3.php";
	$GLOBALS['AdclickPhpPage'] = "adclick.php";
	$GLOBALS['AdclickfPhpPage'] = "adclickf.php";
	$GLOBALS['AdclicksPhpPage'] = "adclicks.php";
	$GLOBALS['AdsubPhpPage'] = "adsub.php";
	$GLOBALS['DoubleMetaRedirectPage'] = "baseredirect.php";
	$GLOBALS['LoopRedirectPage'] = "baseloopredirect.php";
	$GLOBALS['ClickbankSecretKey'] = "";
	$GLOBALS['ClickbankSaleStatus'] = array("SALE", "JV_SALE", "BILL", "JV_BILL");
	$GLOBALS['ClickbankPixelLogging'] = "false";
	$GLOBALS['AffiliateWindowPixelLogging'] = "false";
	$GLOBALS['BlueSnapSaleStatus'] = array("CHARGE");
	$GLOBALS['BlueSnapPixelLogging'] = "false";
	$GLOBALS['RequestMethod'] = "auto";
	$GLOBALS['CaptureFullReferrer'] = "false";
	$GLOBALS['CustomIpHeader'] = "";
	$GLOBALS['UrlEncodeParameters'] = "true";
	$GLOBALS['MaxMultiselectItems'] = 1000;
	$GLOBALS['MobileDetection'] = 3;
	$GLOBALS['ComputerDetection'] = 3;
	$GLOBALS['NoCostForBots'] = 1;
	$GLOBALS['UseDataCaching'] = "false";
	$GLOBALS['CachingMaxItems'] = 1000;
	$GLOBALS['CachingDelay'] = 600;
	$GLOBALS['CachingRemoveTime'] = 2592000;
	$GLOBALS['CachingRemoveCacheRelation'] = 2592000;
	$GLOBALS['UseGeoCron'] = "false";
	$GLOBALS['GeoMaxItems'] = 2000;

A list with all the available options and their default values is in the table below.

Option Name Default Value Description
DateFormat m/d/Y g:i A Pattern used to display dates
DateShortFormat m/d/Y Pattern used to display short dates
ThousandsSeparatorCSV Character used as thousands separator in export file. Default is blank for Excel support
DecimalSeparatorCSV . Character used as decimal separator in export file. Default is . for Excel support
CookieTimeout 2592000 Time interval to keep the tracking cookie
BasePhpPage base.php Name of the base.php page (Campaign URL)
Base2PhpPage base2.php Name of the base2.php page (redirect to next level or offer)
Base3PhpPage base3.php Name of the base3.php page (redirect to offer in LPS campaigns)
AdclickPhpPage adclick.php Name of the adclick.php page (Tracking Pixel and Postback URL)
AdclickfPhpPage adclickf.php Name of the adclickf.php page (Tracking Pixel - iframe version)
AdclicksPhpPage adclicks.php Name of the adclicks.php page (Tracking Pixel - iframe version)
AdsubPhpPage adsub.php Name of the adsub.php page (Tracking Pixel for subscribers/leads)
DoubleMetaRedirectPage baseredirect.php Name of the page used for redirects using the Double Meta Refresh method
LoopRedirectPage baseloopredirect.php Name of the page used for redirects using the Redirect Loop method
ClickbankSecretKey The Secret Key defined in Clickbank; used only when tracking Clickbank conversions
ClickbankPixelLogging false Controls if logging of Clickbank requests is enabled or not
ClickbankSaleStatus array("SALE", "JV_SALE", "BILL", "JV_BILL") Statuses sent from Clickbank that will mark a conversion in CPV Lab Pro
AffiliateWindowPixelLogging false Controls if logging for Affiliate Window requests is enabled or not
BlueSnapSaleStatus array("CHARGE") Statuses sent from BlueSnap that will mark a conversion in CPV Lab Pro
BlueSnapPixelLogging false 'true' if logging for the BlueSnap requests is enabled
RequestMethod auto The method used for external requests like additional pixels
CaptureFullReferrer false Controls if full referrer URLs are captured or just the domain and page name, without query string parameters
CustomIpHeader Name of the custom header used to retrieve visitors’ IP addresses
UrlEncodeParameters true Controls if the parameters appended to LP and Offer pages are URL encoded or not
MaxMultiselectItems 1000 The maximum number of items that will be displayed in the multiselect controls
MobileDetection 3 The Mobile Detection Method Used: 1 - Legacy Mobile Database, 3 - New Mobile Database
ComputerDetection 3 The Computer Detection Method Used: 1 - Main Computer Database, 3 - Alternative Computer Database
NoCostForBots 1 Set to '1' if you want to capture the cost as 0 for bot traffic; set to '0' if the campaign CPV/CPC should be used for bot traffic
UseDataCaching false Controls if cached data are used in application ("true" or "false" values); you must also setup the Cache Cron job
CachingMaxItems 10000 The maximum number of clicks processed in a single Cron job execution
CachingDelay 600 The delay in aggregating clicks; the clicks from the last xxx seconds won't be aggregated yet ( in seconds)
CachingRemoveTime 7776000 The interval after which clicks are removed from the "clicks" table (after these clicks have been aggregated) - in seconds
CachingRemoveCacheRelation 2592000 The interval after which conversions cannot be marked in the aggregated data - in seconds
UseGeoCron false Controls if the GEO details are pulled by the Cron job; otherwise they are captured by the base.php page
GeoMaxItems 20000 he maximum number of clicks geo-encoded in a single Cron job execution
  • The options are defined in the "constants-users.php" file in the following format:

$GLOBALS['option-name'] = "option-value";

  • If the option value is numeric, then you don’t have to add the enclosing double quotes.

More details about the keys that can be configured with the constants-user.php file

DateFormat
  • The pattern used to display the date/time fields inside CPV Lab Pro; you can enter any PHP specific date format. The default format is ‘m/d/Y g:i A’
DateShortFormat
  • The pattern used to display the date fields (short format for the above pattern). The default format is ‘m/d/Y’
ThousandsSeparatorCSV
  • Used in the CSV files as the character that will separate thousands digits in numeric fields. The default value is blank in order to generate CSV files compatible with Microsoft Excel
DecimalSeparatorCSV
  • Used in the CSV files as the decimal separator for numeric fields. The default value is ‘.’
CookieTimeout
  • The tracking cookie length, the time interval that a cookie will be kept inside visitors’ browsers. The value must be specified in seconds, there are several common cookie lengths added as examples and the default value is 2592000 which means 30 days.
DoubleMetaRedirectPage
  • This key holds the file name for the page that performs redirects to offer pages using the Double Meta Refresh method. More details below, in the "Changing Redirect Page Names" section
LoopRedirectPage
  • This key holds the file name for the page that performs redirects to offer pages using the Redirect Loop method More details below, in the "Changing Redirect Page Names" section
ClickbankSecretKey
  • If defined, it must match the Secret Key you entered in your Clickbank account. If not defined, the Clickbank tracking code will not validate the calls received. Using the Secret Key option will bring extra security since the requests received will be validated and only those requests that actually come from Clickbank will be processed.
ClickbankPixelLogging
  • This is used to test and identify issues with Clickbank conversions. It should stay set to “false” until CPV Lab Pro support tells otherwise.
RequestMethod
  • Controls what method is used to make external requests (like firing additional pixels).
  • Possible values are:
    • auto - default option; CPV Lab Pro automatically selects the request method based on server settings
    • contents - use the file_get_contents PHP function for requests
    • curl - use cURL for requests
  • If you know that your server doesn’t allow the “file_get_contents” function, then you can change this option to “curl” and the cURL library will be used for external requests.
  • When set to “auto”, CPV Lab Pro will detect if the “file_get_contents” function is not enabled and will automatically switch to cURL requests.
CaptureFullReferrer
  • The referrer URLs are composed from 2 parts:
    • first part is the domain+page name
    • the second part contains the query string parameters. The query string parameters are not important most of the times and will just take up space in the database. That’s why the default option is to capture referrers without query string parameters.
  • If you need to see the query string parameters, then you have to set the “CaptureFullReferrer” option to “true” in the “constants-users.php” file.
  • A complete referrer URL can look like:

http://domain.com/page.php?c=11&cb=13b&t=123453b0e2db284871894dd73e75249f&d=12345

  • If the query string part isn’t important and won’t be used in reports, it will make sense to capture the referrers without query string parameters and save database space, like:

http://domain.com/page.php

CustomIpHeader
  • If you have a server running a reverse proxy, then the IP address for visitors will be passed using a custom header instead of the regular “REMOTE_ADDR” header.

  • In this case you will define the custom header in this configuration option and CPV Lab Pro will use the custom header to read visitors’ IP addresses.

    • For example:
      • if you have Incapsula reverse proxy, the IP address will be passed in the HTTP_INCAP_CLIENT_IP header
      • so the configuration option from the “constants-users.php” file should be:

    $GLOBALS['CustomIpHeader'] = "HTTP_INCAP_CLIENT_IP";

UrlEncodeParameters
  • The parameters added to the landing pages or offers (like Extra Tokens or Target/Keyword) are URL encoded before they get appended to the URL in order to be retrieved in the pages. If you do NOT want to URL encode operations to these parameters, set this option to “false”.

Changing Page Names

  • The pages that perform redirects can have custom names instead of their default names.
  • Starting with version 5.0, CPV Lab Pro introduced the option to use custom names for the tracking pages (base pages) and pixel pages.
  • More details can be found on the Rename Tracking Links page

You may also find useful: