Driftrock processes events from multiple sources and glues them together using unique fields on a person e.g an ID or email address. This joined up data is what helps you run marketing people will love, track all your campaigns end-to-end, and help protect privacy. 

There are several ways to send data to the Driftrock platform:

  • Using Driftrock's pre-built integrations. 
  • Via Zapier
  • Via the Driftrock Events API  
  • Connecting Google Analytics to add tracking to your leads. 

Using our pre-built integrations

Currently from the dashboard you can link accounts through the integrations console. You'll find a number of pre-built integrations for data sources and marketing platforms like Facebook, Google, LinkedIn Ads, CRM systems, Google Analytics and many more. 

Sending data via Zapier

Driftrock has a handy Zapier integration to send lead and other event data to Driftrock. Just ask your account manager for more info.

The Driftrock Events API

The Driftrock Events API enables you to flexibly send any events you need.

For example:

  • You may wish to send leads that you captured through forms on your website.
  • Another service you use may be capable of submitting data through a webhook. (e.g. HubSpot, Instapage, JotForm, ChatFuel etc)

Generating an API Key

The first step is to generate an API Key for your requests.  Log into the Driftrock dashboard and visit the API Key console.  You should create a new key, and give it the webhooks scope.

For security, we recommend that any API key you use for webhooks, only has the webhooks scope.

Once you’ve created a new key, you will be able to see the key and the secret in the console.  Our endpoints use basic authentication via the Authorization header, expecting the "user" field to be set to the key and the "password" field to be set to the secret.

Making requests

Now you can make a POST request to https://external-apis.driftrock.com/webhooks/events, with the Authorization header.  The request body must be JSON formatted, and contain a fields key, that in turn contains the fields and values you want to send.

If
fields is submitted as an array, only the first item in the array will be processed, and it will be treated as a map.

You may also provide the following optional fields:

  • id an ID that represents this event in your system.  We strongly recommend that you provide this as Driftrock will use it to de-duplicate events that are submitted multiple times for any reason.
  • form_id, if you sent the webhook based on a particular form then you can specify that here.
  • created_at, if you would like to provide a more precise timestamp for when the event occurred.  If you do not provide one, it will be set to the moment Driftrock received the event, this is a subtle distinction but may be important to your business case.  The format is "YYYY-MM-DDTHH:MM:SSZ".

An example with cURL:

curl --user [key]:[secret] https://external-apis.driftrock.com/webhooks/events \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -X POST \
  -d '{"id": "event1", "fields": {"first_name": "Rick", "last_name": "Sanchez"} }'

Sending Events without Auth

Although it is against best practice, some services won't allow you to send headers, which makes it impossible to authenticate in the way described in the previous section.  For situations such as this, there are also routes that allow you to specify an encrypted API key in the path.

We strongly discourage this approach if it can be avoided.

An example with cURL:

curl https://external-apis.driftrock.com/encrypted/[ENCRYPTED_API_KEY]/webhooks/events \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -X POST \
  -d '{"id": "event1", "fields": {"first_name": "Rick", "last_name": "Sanchez"} }'

Advanced Website Lead Tracking with Google Analytics 

You can connect your Google Analytics account to Driftrock to add UTM source, medium, campaign, content and keyword to all the leads that we process from your website forms. 

To do this, you should send a Google Analytics Client ID with each lead as a hidden field from your forms.  For example:

curl https://external-apis.driftrock.com/encrypted/[ENCRYPTED_API_KEY]/webhooks/events \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -X POST \
  -d '{"id": "event1", "ga_client_id": "GA_ID", "fields": {"first_name": "Rick", "last_name": "Sanchez"} }'

If you provide a Google Analytics Client ID, and you have enabled the Google Analytics integration, we will use this ID to add more data about the journey associated with the person. 

You can use this Driftrock script that makes it easier to fetch the GA Client ID and add it into a form.

Did this answer your question?