logo

Sending Website Lead Data to your CRM

Before you continue, implement the SegmentStream SDK snippet on your website.
When sending lead data from your website to your CRM, you should also send the user identifier provided by the SegmentStream SDK.
Instead of using the _ga cookie value, pass the value returned by the following method:
javascript
window.segmentstream.anonymousId()
  • If the user has consented to cookies, this method will return the _ga cookie value.
  • If the user has not consented, it will return a generated anonymous ID (instead of null).
This approach ensures that SegmentStream’s aggregated attribution works for both consented and non-consented users.
How to implement:
  1. Replace the _ga cookie
    1. If your CRM currently receives the _ga cookie value, replace it with window.segmentstream.anonymousId().
  1. If replacement is not possible
    1. Send the anonymousId() value to a separate field in your CRM.
  1. Trigger the Conversion Event on the Same Page
    1. On the same page where the lead is sent to the CRM, you must also call window.segmentstream.conversion().
      Calling the conversion method on a different page, for example, a redirect page after the lead is sent, will not work for aggregated conversion attribution. The call must happen on the same page where the lead is submitted.
  1. Usage Example
    1. javascript
      // code that sends data to the CRM const clientId = window.segmentstream.anonymousId(); sendLeadToCRM({ name: leadName, email: leadEmail, clientId: clientId }); // code that sends data to SegmentStream window.segmentstream.conversion();
This ensures consistent attribution coverage while remaining compliant with privacy regulations.
Share