How to get MXCProspectID from the browser?

This article allows you to understand how to retrieve the MXCProspectID from the browser cookies. MXCProspectID is a JavaScript variable which is generated in the visitor’s browser cookies. When a visitor visits your website or landing pages  associated with LeadSquared. This allows you to capture visitors web activities.

Prerequisites:

  • Full website tracking feature should be enabled in your account(Check your plan details).View more details.
  • Tracking script must be installed in the website. View more details.
  • Domain name should be associated with your LeadSquared account. View more details.
  • Webpage should have variable with the name ProspectID.

Use:

  • If you are implementing the LeadSquared’s Vistor to lead API to capture Lead and Lead’s web activity from your website, check if the MXCProspectID is present in the browser cookies. If present, this script will pass that value to the hidden field ProspectID.
  • If you wish to pass the MXCProspectID to your Google Analytics script to capture the conversion statistics of LeadSquared landing pages, you can use this script to achieve that.

Sent Data

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
<script>

function SetProspectID(){
if (typeof(MXCProspectId) !== "undefined")
jQuery('input[name="ProspectID"]').attr('value', MXCProspectId);
}
window.onload = function() {
setTimeout (SetProspectID , 2000);
};
</script>