### Complete .htaccess Example
Source: https://support.qualityunit.com/898188-Site-Replication-and-subdomains
A full example of the .htaccess file configured for an installation in the /affiliate directory.
```apache
Options +FollowSymLinks
RewriteEngine On
RewriteBase /affiliate/
RewriteCond %{HTTP_HOST} !www.yoursite.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-zA-Z0-9-]+).yoursite.com [NC]
RewriteRule (.*) scripts/page.php?a_aid=%2&a_bid=2063145c&a_file=$1 [L,QSA]
```
--------------------------------
### Install Varnish Repository
Source: https://support.qualityunit.com/208981-WHM--CPanel
Command to install the Varnish repository on a server.
```bash
rpm -Uvh https://repo.varnish-ca...
```
--------------------------------
### Complete example source code
Source: https://support.qualityunit.com/389075-Getting-started-example
Full implementation example including authentication, request execution, and result iteration.
```php
login("merchant@example.com","demo")) {
die("Cannot login. Message: ".$session->getMessage());
}
//----------------------------------------------
// get recordset with list of affiliates
$request = new Pap_Api_AffiliatesGrid($session);
// sets limit to 30 rows, offset to 0 (first row will start)
$request->setLimit(0, 30);
//----------------------------------------------
// send request
try {
$request->sendNow();
} catch(Exception $e) {
die("API call error: ".$e->getMessage());
}
//----------------------------------------------
// request was successful, get the grid result
$grid = $request->getGrid();
//----------------------------------------------
// get recordset from the grid
$recordset = $grid->getRecordset();
echo 'Total number of affiliates: '.$grid->getTotalCount().'
';
echo 'Number of affiliates returned in result: '.$recordset->getSize();
// iterate through the records
foreach($recordset as $rec) {
echo 'Affiliate name: '.$rec->get('firstname').' '.$rec->get('lastname').'
';
}
?>
```
--------------------------------
### Install Varnish via Repository
Source: https://support.qualityunit.com/496090-How-to-Install-and-Configure-Varnish-with-cPanel
Commands to add the Varnish repository and install the package using yum.
```bash
# install varnish repository
rpm -Uvh https://repo.varnish-cache.org/redhat/varnish-3.0/el5/noarch/varnish-release-3.0-1.noarch.rpm
# yum installation of Varnish
yum install varnish
```
--------------------------------
### AppsFlyer Webhook URL Examples
Source: https://support.qualityunit.com/416140-Mobile-apps-tracking
Example webhook URLs for tracking installations and in-app events. Replace 'mycompany' with your actual account name.
```text
Installation: https://mycompany.postaffiliatepro.com /scripts/sale.php?ProductID={app_name}&OrderID={advertising_id}&visitorId={clickid}
```
```text
In-app event: https://mycompany.postaffiliatepro.com /scripts/sale.php?ProductID={mapped-iae}&OrderID={advertising_id}&visitorId={clickid}
```
--------------------------------
### Launch Safari with Debug Menu on Windows
Source: https://support.qualityunit.com/857648-How-to-Enable-the-Debug-Menu-in-Safari-Browsers
Execute this command in the Command Prompt from the Safari installation directory to start the browser with the Debug menu enabled.
```bash
Safari.exe /enableInternalDebugMenu
```
--------------------------------
### Handle Manual Upgrade Errors
Source: https://support.qualityunit.com/009608-Upgrading-MariaDB-100x-to-MariaDB-101x-on-Centos-yum
Example output of a failed upgrade scriptlet indicating that a manual removal and installation is required.
```text
******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.0.21-1.el6.x86_64) is installed.
Upgrading directly from MySQL 10.0 to MariaDB 10.1 may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.
A manual upgrade is required.
- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'
You may choose to use 'rpm --nodeps -ev ' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by Monty Program AB
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program
This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-10.1.8-1.el6.x86_64) scriptlet failed, exit status 1
Error in PREIN scriptlet in rpm package MariaDB-server-10.1.8-1.el6.x86_64
error: install: %pre scriptlet failed (2), skipping MariaDB-server-10.1.8-1.el6
Verifying : MariaDB-server-10.1.8-1.el6.x86_64 MariaDB-server-10.0.21-1.el6.x86_64 was supposed to be removed but is not!
Verifying : MariaDB-server-10.0.21-1.el6.x86_64 Failed:
MariaDB-server.x86_64 0:10.0.21-1.el6 MariaDB-server.x86_64 0:10.1.8-1.el6 Complete!
```
--------------------------------
### Manage Varnish Service
Source: https://support.qualityunit.com/496090-How-to-Install-and-Configure-Varnish-with-cPanel
Commands to enable and start the Varnish service.
```bash
chkconfig varnish on
service varnish start
```
--------------------------------
### View file size limit output
Source: https://support.qualityunit.com/881156-Error-File-Size-Limit-Exceeded
Example output showing the file size limit configuration.
```text
file size (blocks, -f) unlimited
```
--------------------------------
### SEO Link Examples
Source: https://support.qualityunit.com/270890-Track-subID-dynamically
Examples of formatted SEO links incorporating channel and data parameters.
```text
https://www.yoursite.com/ref/testaff/11110000/home
```
```text
https://www.yoursite.com/ref/testaff/11110000/home/data1/
```
--------------------------------
### Click Tracking URL Example
Source: https://support.qualityunit.com/394224-Sale-Tracking
Example of a full URL request made to the tracking script, which can be inspected in the browser's Network tab to verify tracking parameters.
```text
https://demo.postaffiliatepro.com/scripts/3r05xk1?visitorId=270894e71bef89a0a33e6150cb91Ttl2&accountId=default1&tracking=S&url=H_localhost%2Ftest%2Fsale.html&referrer=H_localhost%2Ftest%2Fhome.html%3Fa_aid%3Dtestaff&getParams=&anchor=&isInIframe=false&cookies=
```
--------------------------------
### Set RewriteBase for Directory Installation
Source: https://support.qualityunit.com/898188-Site-Replication-and-subdomains
Use this configuration if Post Affiliate Pro is installed in a subdirectory.
```apache
RewriteBase /affiliate/
```
--------------------------------
### Initialize .htaccess Rewrite Rules
Source: https://support.qualityunit.com/898188-Site-Replication-and-subdomains
Basic setup for enabling rewrite engine and symlinks in the .htaccess file.
```apache
Options +FollowSymLinks
RewriteEngine On
```
--------------------------------
### Sale Tracking Request URL Example
Source: https://support.qualityunit.com/038895-Sale-action-tracking-request-data-description
A raw URL example showing how the sale tracking request is structured with URL-encoded JSON parameters.
```text
https://my_pap_url/scripts/track.php?visitorId=b910a79d013c8856a01393511GPTWP0s&accountId=&url=H_localhost%2Ftests%2Fapi%2Fme%2Fsale.php&referrer=&tracking=1&getParams=&ip=127.0.0.1&sale=%5B%7B%22ac%22%3A%22%22%2C%22t%22%3A%22100%22%2C%22f%22%3A%22%22%2C%22o%22%3A%22oid%22%2C%22p%22%3A%22pid%22%2C%22d1%22%3A%22data1value%22%2C%22d2%22%3A%22data2value%22%2C%22d3%22%3A%22data3value%22%2C%22d4%22%3A%22data4value%22%2C%22d5%22%3A%22data5value%22%2C%22a%22%3A%22testaff%22%2C%22c%22%3A%2255a22310%22%2C%22b%22%3A%22%22%2C%22ch%22%3A%22channelid%22%2C%22cc%22%3A%22%22%2C%22s%22%3A%22A%22%2C%22cr%22%3A%22Eur%22%2C%22cp%22%3A%22couponcode%22%2C%22ts%22%3A%22%22%2C%22dndc%22%3A%22Y%22%7D%5D
```
--------------------------------
### API Request and Response Example
Source: https://support.qualityunit.com/354854-C-NET-Communication-with-API
Example of the raw JSON request sent to the server and the corresponding JSON response.
```json
REQUEST: {"C":"Gpf_Rpc_Server","M":"run","requests":[{"C":"Pap_Merchants_Payout_PayoutsHistoryGrid","M":"getRows"}],"S":"ep6udpp8i2mgnh70vdp52on5h3"}
RESPONSE: [{"rows":[["id","payouthistoryid","dateinserted","merchantnote","affiliatenote","accountid","amount","users"],["0bc99b08","0bc99b08","2011-03-25 05:39:49","","","default1",99,"1 payee"]],"count":1}]
0bc99b08;99;default1;1 payee;
```
--------------------------------
### Start the Elasticsearch service
Source: https://support.qualityunit.com/067573-Verifying-the-Status-of-the-Elasticsearch-Service
Commands to start the service if it is currently inactive, requiring appropriate system privileges.
```bash
systemctl start elasticsearch
```
```bash
service elasticsearch start
```
--------------------------------
### Full Advanced Click Tracking Implementation
Source: https://support.qualityunit.com/417400-Clicks-referrals-tracking
Complete example showing the placement of various configuration functions relative to the PostAffTracker.track() call.
```javascript
```
--------------------------------
### Retrieve list of banners
Source: https://support.qualityunit.com/922663-Low-level-API
Complete example showing session authentication and grid request execution to fetch banners.
```php
include 'path/to/your/api/file/PapApi.class.php';
$session = new Pap_Api_Session("https://localhost/scripts/server.php"); //replace https://localhost/scripts with link to your PAP installation URL
if(!$session->login("merchant_name", "merchant_password")) {
die('Failed authentication');
}
$request = new Gpf_Rpc_GridRequest("Pap_Merchants_Banner_Banne...
```
--------------------------------
### Install and use ClamAV
Source: https://support.qualityunit.com/646634-Server-Administration
Commands for installing the ClamAV antivirus, updating its database, and performing a system scan.
```bash
yum install clamav clamd
```
```bash
freshclam
```
--------------------------------
### Sale Tracking with Custom Suffix
Source: https://support.qualityunit.com/399925-Tracking-the-same-page-e-commerce-site-by-multiple-PAPPAN-installations---click-tracking-of-multiple-PAPPAN-installations-on-the-same-page
Example implementation for tracking sales using a custom suffix.
```html
```
--------------------------------
### Set RewriteBase for Root Installation
Source: https://support.qualityunit.com/898188-Site-Replication-and-subdomains
Use this configuration if Post Affiliate Pro is installed in the root directory.
```apache
RewriteBase /
```
--------------------------------
### Manual Package Removal and Installation
Source: https://support.qualityunit.com/009608-Upgrading-MariaDB-100x-to-MariaDB-101x-on-Centos-yum
Commands to identify, remove, and reinstall MariaDB packages when automatic updates fail.
```bash
rpm -qa | grep -i '^MariaDB'
```
```bash
yum remove MariaDB-server
```
```bash
yum install MariaDB-server
```
--------------------------------
### Pap_Api_Session::getAppVersion
Source: https://support.qualityunit.com/931835-Pap_Api_Session
Retrieves the version of the Post Affiliate Pro installation.
```APIDOC
## Pap_Api_Session::getAppVersion
### Description
Returns the version string of the connected Post Affiliate Pro installation.
### Signature
`string|false getAppVersion()`
```
--------------------------------
### Example of a Full Absolute URL
Source: https://support.qualityunit.com/249547-API-Curl-Error-url-Malformed
Use this format for API endpoints to avoid malformed URL errors.
```text
https://yourdomain.com/path/to/api
```
--------------------------------
### Manage MariaDB Service
Source: https://support.qualityunit.com/009608-Upgrading-MariaDB-100x-to-MariaDB-101x-on-Centos-yum
Commands to stop and start the MySQL service during the upgrade process.
```bash
service mysql stop
```
```bash
service mysql start
```
--------------------------------
### PHP Sale Tracking Request Implementation
Source: https://support.qualityunit.com/038895-Sale-action-tracking-request-data-description
A PHP example demonstrating how to construct and send a sale tracking request using cURL.
```php
"",
"t"=>"100",
"f"=>"",
"o"=>"myorderid",
"p"=>"myproductid",
"d1"=>"data1value",
"d2"=>"data2value",
"d3"=>"data3value",
"d4"=>"data4value",
"d5"=>"data5value",
"a"=>"",
"c"=>"",
"b"=>"",
"ch"=>"",
"cc"=>"",
"s"=>"",
"cr"=>"",
"cp"=>"couponcode"
));
$accountId = 'default1';
$visitorid = @$_COOKIE['PAPVisitorId'];
$ip = $_SERVER['REMOTE_ADDR'];
$referer = encodeUrlParam($_SERVER['HTTP_REFERER'] ?? '');
$urlParam = encodeUrlParam('https://'.$_SERVER["SERVER_NAME"].$_SERVER['SCRIPT_NAME']);
$url ='https://your_postaffiliatepro_url/scripts/track.php?visitorId='.$visitorid. '&accountId='.$accountId.'&url='.$urlParam.'&referrer='.$referer.'&tracking=1&getParams=&ip='.$ip;
$encodedSaleData = 'sale=' . urlencode(json_encode($saleData));
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $encodedSaleData);
$response = curl_exec($curl);
if ($response === false) {
error_log('PAP sale tracking failed: ' . curl_error($curl));
curl_close($curl);
return;
}
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($httpCode !== 200) {
error_log('PAP sale tracking returned HTTP ' . $httpCode . ': ' . $response);
return;
}
echo ($response);
function encodeUrlParam($url) {
$url = str_replace('http://', 'H_', $url);
$url = str_replace('https://', 'S_', $url);
return $url;
}
?>
```
--------------------------------
### Retrieve Post Affiliate Pro version
Source: https://support.qualityunit.com/931835-Pap_Api_Session
Check the version of the Post Affiliate Pro installation using the session object.
```php
**getAppVersion()) {
echo 'Post Affiliate Pro version: ' . $papversion;
} else {
echo 'Failed to load version with error: ' . $session->getMessage();
}
?>**
```
--------------------------------
### Create VirtualHost Configuration File
Source: https://support.qualityunit.com/097832-How-to-Create-a-Directory-and-Configure-a-Custom-VirtualHost-for-a-Domain-in-cPanel
Open the configuration file for editing using the nano text editor. Ensure you replace the username and domain placeholders.
```bash
nano /etc/apache2/conf.d/userdata/std/2_4/username/yourdomain.com/virtualhost.conf
```
--------------------------------
### Requesting Grid Rows
Source: https://support.qualityunit.com/110653-Data-model-JSON-description
Example JSON request for loading affiliate grid rows using the Gpf_Rpc_GridRequest structure.
```json
{"C":"Pap_Merchants_User_AffiliatesGrid", "M":"getRows", "sort_col":"dateinserted", "sort_asc":false, "offset":0, "limit":30,"filters":[["dateinserted","DP","TY"],["rstatus","IN","A,D,P"]], "columns":[["id"],["id"],["refid"],["userid"],["username"],["firstname"],["lastname"],["rstatus"],["parentuserid"],["parentusername"],["parentfirstname"],["parentlastname"],["dateinserted"],["actions"]], "S":"u2on93uhrr6jqbvjl32ncui4f0"}
```
--------------------------------
### Install ClamAV on CentOS
Source: https://support.qualityunit.com/144858-Scanning-Your-Server-for-Viruses-or-Malware
Use this command to install the ClamAV package on a CentOS system.
```bash
yum install clamav clamd
```
--------------------------------
### Register a new affiliate using Pap_Api_AffiliateSignup
Source: https://support.qualityunit.com/397716-Pap_Api_AffiliateSignup
Demonstrates the initialization of the signup object, setting affiliate details, custom data fields, and executing the add method.
```php
setUsername("testaffiliate@email.com");
$affiliate->setParentUserId('testaff');
$affiliate->setFirstname("test");
$affiliate->setLastname("affiliate");
$affiliate->setRefid('testaff10');
$affiliate->setData(1, "urlExample");
$affiliate->setData(2, "companyNameExample");
$affiliate->setData(3, "streetExample");
$affiliate->setData(4, "cityExample");
$affiliate->setData(5, "streetExample");
$affiliate->setData(6, "GB");
$affiliate->setPassword("affpassword"); // use it if you want to set password
try {
if ($affiliate->add()) {
echo "Affiliate saved successfully id: " . $affiliate->getUserid();
} else {
die("Cannot save affiliate: ".$affiliate->getMessage());
}
} catch (Exception $e) {
die("Error while communicating with PAP: ".$e->getMessage());
}
?>
```
--------------------------------
### Implement Click Tracking on a Webpage
Source: https://support.qualityunit.com/011848-Custom-integrations--tracking-scripts
Use this JavaScript snippet to track clicks on a webpage. Replace URL_TO_PostAffiliatePro with your actual installation URL.
```javascript
```
--------------------------------
### Display PHP configuration information
Source: https://support.qualityunit.com/263301-How-to-find-the-location-of-phpini-on-our-server-
Create a file with this content to generate a report containing server configuration details, including the path to php.ini.
```php
```
--------------------------------
### Update image URLs using PHP API
Source: https://support.qualityunit.com/231654-How-to-update-URL-links-of-images
Use this script to replace old URL segments with new ones across your Post Affiliate Pro installation. Ensure you replace the placeholder credentials and URL paths with your actual installation details.
```php
login('merchant_username', 'merchant_password')) {
die("Cannot login. Message: ". $session->getMessage());
}
$urlSearchOldPart = 'https://my_old_PAP_url/';
$urlReplaceNewPart = 'https://my_new_PAP_url/';
$request = new Gpf_Rpc_ActionRequest('Pap_Common_Utils_LinksUpdater', 'updateImagesUrlLinks', $session);
$request->addParam('oldUrlPart', $urlSearchOldPart);
$request->addParam('newUlrPart', $urlReplaceNewPart);
try {
$request->sendNow();
} catch(Exception $e){
die("API call error: " . $e->getMessage());
}
$answer = $request->getResponseObject()->toObject();
if ($answer->success != GPf::YES) {
echo 'Error occured: ' . $answer->errorMessage;
}
echo $answer->infoMessage;
?>
```
--------------------------------
### Retrieve list of affiliates with paging
Source: https://support.qualityunit.com/233666-Gpf_Rpc_GridRequest
Demonstrates how to fetch affiliate data in chunks using a loop, setting limits and specific columns for the grid request.
```php
//----------------------------------------------
// get recordset with list of affiliates
$request = new Gpf_Rpc_GridRequest("Pap_Merchants_User_AffiliatesGrid", "getRows", $session);
// sets limit to 30 rows, offset to 0 (first row starts)
$request->setLimit(0, 30);
// sets columns, use it only if you want retrieve other as default columns
$request->addParam('columns', new Gpf_Rpc_Array(array(array('id'), array('refid'), array('userid'), array('username'), array('firstname'), array('lastname'), array('rstatus'), array('dateinserted'), array('salesCount'), array('clicksRaw'), array('clicksUnique'))));
// execute request in a loop to load all data
do {
// send request
try {
$request->sendNow();
} catch(Exception $e) {
die("API call error: ".$e->getMessage());
}
// request was successful, get the grid result and its recordset
$recordset = $request->getGrid()->getRecordset();
// iterate through the records
foreach($recordset as $rec) {
echo 'Affiliate name: '.$rec->get('firstname').' '.$rec->get('lastname').'
';
}
} while ($recordset->getSize() == $request->getLimit());
```
--------------------------------
### get($columnName)
Source: https://support.qualityunit.com/984168-Gpf_Data_RecordSet
Retrieves the value of a specific column for a record within the recordset.
```APIDOC
### get($columnName)
Retrieves the value of the specified column for the current record.
**Parameters:**
- **$columnName** (string) - The name of the column to retrieve.
**Returns:**
- (mixed) The value of the column.
```
--------------------------------
### Retrieve a list of banners
Source: https://support.qualityunit.com/217961-Pap_Api_BannersGrid
Demonstrates how to initialize the grid request, define columns, set pagination limits, and iterate through the resulting recordset.
```php
//----------------------------------------------
// get recordset with list of banners
$request = new Pap_Api_BannersGrid($session);
//columns that you want to load (unless the default columns are enough)
$request->addParam('columns', new Gpf_Rpc_Array(array(array('id'), array('banner'),
array('rtype'), array('campaignid'), array('destinationurl'), array('rstatus'),
array('impressionsRaw'), array('clicksRaw'), array('ctrRaw'), array('salesCount'),
array('scrRaw'), array('commissions'), array('size'), array('description'), array('rorder'),
array('dateinserted'))));
// sets limit to 30 rows (maximum rows per one request is 500 rows). Starting with first row. Offset is not supported since version 5.11.8.1
$request->setLimit(0, 30);
// send request
try {
$request->sendNow();
} catch(Exception $e) {
die("API call error: ".$e->getMessage());
}
// request was successful, get the grid result
$grid = $request->getGrid();
// get recordset from the grid
$recordset = $grid->getRecordset();
// iterate through the records
foreach($recordset as $rec) {
echo 'Banner name: '.$rec->get('name').'
';
}
```
--------------------------------
### Update MariaDB via YUM
Source: https://support.qualityunit.com/009608-Upgrading-MariaDB-100x-to-MariaDB-101x-on-Centos-yum
Execute the update command to upgrade installed packages.
```bash
yum update
```
--------------------------------
### Short Anchor Link Format
Source: https://support.qualityunit.com/793411-Click-tracking
Example of an anchor-based affiliate link used for tracking.
```text
https://www.yourdomain.com/#AffiliateID&a_bid=BannerID
```
--------------------------------
### Expired session response
Source: https://support.qualityunit.com/931835-Pap_Api_Session
Example of the JSON response received when a session ID is no longer valid.
```json
{"e":"session_closed"}
```
--------------------------------
### payAffiliates(paymentNote, affiliateNote, send_payment_to_affiliate, send_generated_invoices_to_merchant, send_generated_invoices_to_affiliates)
Source: https://support.qualityunit.com/091326-Pap_Api_Payouts
Launches the payout process for the selected affiliates.
```APIDOC
## payAffiliates(paymentNote, affiliateNote, send_payment_to_affiliate, send_generated_invoices_to_merchant, send_generated_invoices_to_affiliates)
### Description
Launches the payout process. Allows setting notes for the merchant and affiliate, and configuring notification and invoice generation settings.
### Parameters
- **paymentNote** (string) - Optional - Note for the merchant.
- **affiliateNote** (string) - Optional - Note for the affiliate.
- **send_payment_to_affiliate** (string) - Optional - Set to 'Y' to send a notification email to the affiliate.
- **send_generated_invoices_to_merchant** (string) - Optional - Set to 'Y' to generate and deliver an invoice to the merchant.
- **send_generated_invoices_to_affiliates** (string) - Optional - Set to 'Y' to generate and deliver an invoice to the affiliate.
```
--------------------------------
### Update RewriteRule with Banner ID
Source: https://support.qualityunit.com/898188-Site-Replication-and-subdomains
Example of the final RewriteRule updated with a specific banner ID.
```apache
RewriteRule (.*) scripts/page.php?a_aid=%2&a_bid=2063145c&a_file=$1 [L,QSA]
```
--------------------------------
### Initialize Pap_Api_Session
Source: https://support.qualityunit.com/427087-Pap_Api_Transaction
Establishes a session with the Post Affiliate Pro API as a merchant.
```php
getVisitorId();
```
--------------------------------
### Initialize YouTube player reference
Source: https://support.qualityunit.com/724732-How-to-track-a-video-playback-events
Retrieves the player object and attaches an event listener for state changes.
```javascript
```
--------------------------------
### Get recurring commission rules
Source: https://support.qualityunit.com/892899-Work-with-commissions
Retrieves details for recurring rules defined in the merchant panel.
```php
login("mer
```
--------------------------------
### GET /scripts/track.php
Source: https://support.qualityunit.com/038895-Sale-action-tracking-request-data-description
Tracks a sale or action by sending visitor and sale-specific data to the tracking script.
```APIDOC
## GET /scripts/track.php
### Description
Sends sale or action tracking information to the Post Affiliate Pro server. The request includes common tracking parameters and a JSON-encoded 'sale' parameter containing specific transaction details.
### Method
GET (with query parameters) or POST (with encoded sale data)
### Endpoint
/scripts/track.php
### Query Parameters
- **visitorId** (string) - Required - The unique visitor identifier.
- **accountId** (string) - Required - The account identifier.
- **url** (string) - Required - The URL where the tracking occurs.
- **referrer** (string) - Optional - The referring URL.
- **tracking** (integer) - Required - Set to 1 to enable tracking.
- **ip** (string) - Required - The IP address of the visitor.
- **sale** (string) - Required - URL-encoded JSON string containing sale data.
### Sale Data Parameters (within 'sale' JSON)
- **ac** (string) - Optional - Action code for action commissions.
- **t** (string) - Required - Total cost.
- **f** (string) - Optional - Fixed cost.
- **o** (string) - Optional - Order ID.
- **p** (string) - Optional - Product ID.
- **d1-d5** (string) - Optional - Extra custom data fields.
- **a** (string) - Optional - Affiliate ID.
- **c** (string) - Optional - Campaign ID.
- **b** (string) - Optional - Banner ID.
- **ch** (string) - Optional - Channel ID.
- **cc** (string) - Optional - Custom commission.
- **s** (string) - Optional - Status ('A', 'P', 'D').
- **cr** (string) - Optional - Currency of sale.
- **cp** (string) - Optional - Coupon code.
- **dndc** (string) - Optional - Do not delete cookies flag ('Y').
### Response
- If the visitor cookie is empty, the response returns a value to be saved in the cookie.
- If the cookie is already set, the response is empty (blank).
```
--------------------------------
### Configure server name resolution in settings.php
Source: https://support.qualityunit.com/718440-Installation-FAQ
Add this line to the settings.php file in the affiliate/accounts directory to resolve license validation issues caused by subdomain configurations.
```text
serverNameResolveFrom=HTTP_HOST
```
--------------------------------
### Integrate WHMCS with Post Affiliate Pro
Source: https://support.qualityunit.com/092846-Integration-related
Create a hook file in the /includes/hooks/ directory to track checkout and invoice events. Ensure the path to PapApi.class.php is updated correctly.
```php