1st Party Cookie

Click Id information should be read from the adp_cid parameter on the request to the website.

Example affiliate url contains unique Click ID and offerId data:

https://yoursite.com/?adp_cid=7ede74f7-db12-4b99-b1ee-2c68247a5c64&adp_oid=555555

Adpartners will automatically populate a new Click ID for each customer click with "adp_cid" parameter on query string.

Related offer id will be send at "adp_oid" on query string

• This cookie should be refreshed for every request with Adpartners Click ID.

• Offer Id value should add to cookie value separated with "_" (Underscore) char.

• The cookie domain must be the same as the brand website domain.

• Cookie name must be "_adp".

• The secure attribute of the cookie must be set.

• The cookie period is 13 months. This time is compatible with other storage methods of this solution.

• If your tracking needs require cross-site accessing of the cookie, the SameSite attribute should be set to None.

• The httpOnly attribute should not be set. This ensures that the cookie can be read by JavaScript.

Use the following scripts to set apt cookie

$adp_cid = $_GET['adp_cid'] ?? null;
$adp_oid = $_GET['adp_oid'] ?? null;

if ($adp_cid) {
    $adp_cookie_value = $adp_cid . "_" . $adp_oid;
    $cookie_options = [
        'expires' => time() + (13 * 30 * 24 * 60 * 60),
        'path' => '/',
        'domain' => '.yoursite.com', // change with brand top level domain
        'secure' => false,
        'httponly' => false
    ];
    setcookie('_adp', $adp_cookie_value, $cookie_options);
}

Please follow:

  1. time() + (13 * 30 * 24 * 60 * 60): This represents the expiration time of the cookie. The time() function returns the current timestamp in seconds since the Unix Epoch. In this case, we add the duration of 13 months to the current time by multiplying the number of seconds in a month (30 * 24 * 60 * 60) and adding it to the current timestamp. This ensures that the cookie will expire 13 months from the current time.

  2. '/': This represents the path on the server where the cookie is available. In this case, it is set to '/', which means the cookie will be accessible across all paths on the server.

  3. '.yoursite.com': This represents the domain for which the cookie is valid. In the provided code, it is set to '.yoursite.com', but you should replace it with your brand's actual top-level domain. By setting the domain to 'yoursite.com', the cookie will be accessible by any subdomain of yoursite.com.

  4. false: This represents the "Secure" flag of the cookie. When set to false, it means the cookie can be transmitted over both secure (HTTPS) and non-secure (HTTP) connections. If set to true, the cookie will only be transmitted over secure connections.

  5. false: This represents the "HttpOnly" flag of the cookie. When set to false, it means the cookie can be accessed by client-side scripts. If set to true, the cookie will be inaccessible to client-side scripts, enhancing the security of the cookie against cross-site scripting (XSS) attacks.

These constant values define the behavior and characteristics of the cookie that will be set. You can modify them based on your specific requirements and security considerations.

Last updated