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.
To begin collecting the PID from your website, make sure to do the following:
- 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;
- 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
- 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.
- The PID cookie is set after a Prospect visits a page containing the Lead Liaison Tracking Code.
- The cookie will get updated every time a Prospect goes to a new tracked page.
- The cookie can be decoded using any base64 decoding function.
- The cookie expires after 1 year; however, the expiration date is updated every time the Prospect visits a tracked page.
- The cookie is not added by default. It is added only if the tracking code contains the flag mentioned above.
- 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.