Webhook
Profit tracking

Profit Tracking with Webhook

Webhook enables companies to operate advertising based on profit data instead of revenue data. Profit data can be securely recorded server-side so that profit data is not made available via the web session (as it would be if recorded via tracking pixels). Here we provide an example setup of tracking profit data with Tracklution webhook.

Instead of firing a Purchase event when a purchase happens in web, you can only fire a ContactInfo tag with data for session matching, such as ´externalId´. External ID can be any unique ID for the purchase that you have available in the web session and in your eCom or other backend system, such as order ID.

<script>
    lsq('set', 'ContactInfo', {externalId: '123-abc'});
</script>

You can also pair this with a Custom Event if you still wish to record also an event of a Purchase in the web session side:

<script>
    lsq('track', 'WebPurchase');
    lsq('set', 'ContactInfo', {externalId: '123-abc'});
</script>

Then, set up a webhook that will track the actual Purchase event along with the profit value. This way, the actual Purchase event with Profit value is recorded fully server-side, without access to profit data during the web session.

For background information: Read more about setting up webhooks

⚠️

Remember to set up Webhook according to our onboarding guide inside your Tracking Container. The example below includes test data only for demonstration purposes.

Example GET request

https://tralut.MyWebSite.com/collect/hook?k=LS-1234567-8&track=Purchase&value=75.10&currency=USD
&email=myemail@gmail.com&phone=+358501212645&externalId=123-abc

Example POST request

{
  "externalId": "123-abc",
  "track": "Purchase",
  "value": "75.10",
  "currency": "USD",
  "email": "myemail@gmail.com",
  "phone": "+358501212645"
}