Setup : Post-click tracking (Secure)

Configuring Post-click tracking is a two stage process, involving the email message and your website.

1. Email Message

2. Secure Website

  • Add "maild={~mailId~}" to the end of the links in the email message that leads to the website
    <a href="http://www.foo.com/salespage.html?_pureTrackingName=FOOSALES&mailId={~mailId~}" >SALES PAGE</a>
  • Programmatically capture the mailId and store this in the recipient's browser session.
    
    <?php
        session_start();
        $mailId = $_GET['mailId'];
        $_SESSION['mailId'] = $mailId;
    ?>
    
  • To send a post-click tracking event back simply make a http request with the following structure:
    http://response.pure360.com/_act/tracking.php?id=CAPTURED-MAIL-ID&_pureTrackingName=FOOSALES&type=SALE&desc=49.99
    <?php
    // Configure our url parameters
    $data = array(
                'id' => $_SESSION['mailId'],
                '_pureTrackingName' => "FOOSALES",
                'type' => "SALE",
                'desc' => 49.99
            );
    $params = http_build_query($data);
    // Get cURL resource
    $curl = curl_init();
    // Set some options
    curl_setopt_array($curl, array(
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_SSL_VERIFYPEER => true,
        CURLOPT_SSL_VERIFYHOST => 2,
        CURLOPT_CAINFO => 
            'path/to/certificate/PureResponse.crt',
        CURLOPT_URL => 
            'https://response.pure360.com/_act/tracking.php?'.$params
    ));
    // Send the request & save response to $resp
    $resp = curl_exec($curl);
    // Close request to clear up some resources
    curl_close($curl);
    ?>