Raw trackers

Match offline lead events with online web sessions in Leadtosale.

The purpose raw trackers

The raw tracker is like a general purpose call tracker. Its purpose is to match offline events with web sessions, by logging web sessions, and attributing offline events to the last recorded web session. There are a few different applications for this.

  1. Bringing your own call infrastructure to Leadtosale.
  2. When you can’t listen for appropriate events on your website from the client side. For example, Intercom does not let you listen for ‘email added’ events from the client side, to be able to fire tags when this happens.
  3. Any other events that need to be matched to web sessions, which you cannot listen for online.

We’ll run you through an example of listening for phone call events on your Android phone, and reconciling these with web sessions. This solution leverages the Leadtosale raw tracker and IFTTT.

Leadtosale records all web sessions on your website, and IFTTT sends a request to Leadtosale when there’s an incoming phone call. When Leadtosale receives the request, it will store the phone call as a lead, and uses the last hit on the raw tracker to give that lead its web session identifiers, like referrer, Google Analytics client ID and more.

This gets less accurate for high traffic websites. The raw tracker has additional tools to improve the accuracy of the web reconciliation, which we will explore later.


In order to use the raw tracker, you’ll need to create a container, and install the container snippet on the website you’d like to track.

Creating a raw tracker

To create a raw tracker, head to the trackers section of your container through the header menu, and select the create new ‘RAW TRACKER’ button.

Configuration options

When you create a raw tracker you can:

  1. Give it a name (required)
  2. Choose to send new leads to Google Analytics, in addition to sales (optional)
  3. Require email address (optional) - if ticked, new leads for the raw tracker will be treated as invalid if they do not have an email address.
  4. Disable the tracker (optional) - if you don’t want this to go live straight away, tick this box.
  5. Alert users on new leads (optional) - send new lead alerts to users that have access to the business.

Once you’ve configured and saved your tracker, open it from the trackers page to view your tracker URL.

Once you’ve selected the raw tracker you want to send leads to, click the “VIEW INSTRUCTIONS” button.

This will give you instructions for your raw tracker for creating leads.

Creating new raw tracker leads

To create a raw tracker lead, you’ll need to send a POST request to your tracker’s URL, and format that request as JSON. For example, I could create a new lead with the phone number “+64123456” for this tracker using the following request:

curl --header "Content-Type: application/json" --request POST --data '{"phone_number":"+64123456"}' https://app.leadto.sale/raw/r2LJN

Any field that matches an email address or phone number will automatically be the “title” of that lead. If one is not provided, the lead title will be the ID number of that lead.

When a valid request is made to this URL, Leadtosale will:

  1. Create a new lead, with the request body’s key values associated with the lead.
  2. Associate that lead with the last recorded web hit for that tracker. If one cannot be associated, it will display “lead not matched to web visit”.
  3. If Send New Leads to GA or Alert Users on New Leads are configured on the tracker, they will run.

Let’s run through an example of this using IFTTT.

Example: Tracking calls to Android device in Google Analytics with your existing number.

Renting tracking numbers can be expensive - use your existing Android device and SIM to track calls in Google Analytics.

  1. Install the IFTTT app on your Android device.
  2. Create a new Applet, select “this” and select the “Android Phone Call” app for the trigger.
  3. Select “incoming phone calls”.
  4. Give it the appropriate permissions to listen for incoming calls.
  5. Select “that” and add the “Webhooks” app for your trigger.
  6. Add your raw tracker URL as the URL.
  7. Select the “POST” method.
  8. Select the “application/JSON” content type.
  9. Configure your request body. Our suggested configuration is:
'contact_name': '{{ContactName}}', 'phone_number':'{{FromNumber}}', 'event_time':'{{OccurredAt}}', 'duration':'{{CallLength}}'

10. Set the Applet live.

Now, as new calls come through to your Android device (and it is connected to the internet), Leadtosale will create new leads associated with the user who last loaded a page on your website, and use that information to send an event to Google Analytics.

If this lead eventually closes, you can then send another event to Google Analytics with the value of that deal, by processing the lead.

Improving the web session matching accuracy

We have a number of options for improving the matching accuracy of raw trackers.

  1. Use special fields to reconcile sessions by ga_cookie, ip_address or event_time
  2. Use raw trackers for certain traffic channels only.

We’ll go through these examples below.

Using special fields in your lead request

In your request body, you can include the following fields to reconcile by the last session from a particular user that matched criteria

'ip_address':{{a user's IP address like}},
'ga_cookie':{{a user's GA cookie like GA1.2.624790686.1559874306}},
'event_time':{{ISO 8601 datetime with timezone YYYY-MM-DDTHH:mm:ssZ e.g. 2006-01-22T23:04:05-0000}}

This way you can:

  1. Selectively reconcile by IP address. For example, if you know someone’s IP address from interactions in an iframe, you can use this to make sure the raw lead for an interaction in that iframe (like a booking) is associated to the correct user.
  2. Selectively reconcile by ga_cookie. For example, you could know a lead’s ga_cookie server side, you can match it with their sessions on the client side using this field.
  3. Selectively reconcile by event_time. For example, if you know a call lead came through at 11 23pm, 22nd of Jan 2006 (UTC time), then you can match it to the last hit before that date.

You can combine these conditions as well to further improve accuracy.

Using the raw tracker to track leads from certain traffic sources

Like the call tracker, you can selectively reconcile leads back to certain channels using replacement logic. For example, if I only want to look at Google Ads sessions where I received emails to a certain address, I can do that like the below:

In this case, I have made my email (cwarner@leadt.sale) swap out for cwarner+leads@leadto.sale. When I get an email which has +leads in my inbox, I send a POST request to my raw tracker URL. Then, it will match that lead to the last Google Ads user.

You can combine this with the special field functionality to ensure you’re accurately tracking leads back to their traffic source, and with the event time functionality you can do this asynchronously.

This is powerful, as you can essentially turn a call log from a different phone number into a Google Ads call tracking system.

Questions and support

If you have any questions about the raw tracker, reach out to the team through that chat and we’ll be happy to answer them.

We offer managed raw tracker implementations to our enterprise customers. If you’d like to upgrade to an enterprise plan, you can do so by messaging us in the chat.