Collect Prospect ID from Visitors

Overview

Each visitor, whether known (has an email) or anonymous, has an ID associated with them. We call this ID the Prospect ID, or PID. The PID can be used in various ways, such as accessing Lead Liaison's API to look up a Prospect by the PID value, logging a Custom Activity, and more. Lead Liaison stores an encrypted version of the PID in a browser cookie, named ll_prospect_id_encoded.

Implementation

To begin collecting the PID from your website, make sure to do the following:

  • Set a JavaScript variable. 
  • We suggest updating your Lead Liaison Tracking code so that all tracking code parameters are in one place. 
var ll_is_append_prospect_identifier_cookie = true;

Note on Location

This value must be before this line, LazyLoad.js('https://t1.llanalytics.com/tracking_engine/collector.php');

  • The cookie will get added only if the prospect goes to a page with your tracking code. The tracking code must have this flag set: var ll_is_append_prospect_identifier_cookie = true;
  • In the example below we show the updated website tracking code and cookie inspection. 

Reading the Prospect ID

The PID is stored as a browser cookie and encrypted using base64. To read the PID via JavaScript and decrypt it use the following code:

  • Reading PID: ll_api.get_prospect_id_from_cookie ();
  • Decrypting PID: atob("encrypted_value");

In the example below, we're using the Console tab in Google Chrome to read and decrypt the PID. 

Notes

  1. The PID cookie is set after a Prospect visits a page containing the Lead Liaison Tracking Code. 
  2. The cookie will get updated every time a Prospect goes to a new tracked page.
  3. The cookie can be decoded using any base64 decoding function.
  4. The cookie expires after 1 year; however, the expiration date is updated every time the Prospect visits a tracked page.
  5. The cookie is not added by default. It is added only if the tracking code contains the flag mentioned above.
  6. The PID can change if a conversion happens with an email that already exists in the system. It's a best practice to read the cookie value only when you need it, as it could change in this aforementioned scenario. 


  

© 2021 Lead Liaison, LLC. All rights reserved.

13101 Preston Road Ste 110 – 159 Dallas, TX 75240 | T 888.895.3237 | F 630.566.8107 www.leadliaison.com | Privacy Policy