How to send website events and leads to Driftrock

The simple, powerful way to capture website events and implement Conversion API integrations across multiple channels.

An intro

The Driftrock Automotive Marketing Platform helps you capture, track and automate marketing campaigns across all channels, including your website.

In addition to 3rd party lead sources and tools, Driftrock can help you increase the number of leads and conversions from your website in a number of ways. 

In this guide, we discuss why and how to manage your website lead and event data with Driftrock.

Why send website lead & event data to Driftrock? 

Starting 4th January 2024, Google will begin deprecating the 3rd party cookie, whilst iOS has had this in place for some time now. 

These changes will make tracking effectiveness of advertising and targeting significantly harder without putting in place the right tools. 

With a single website integration, once you begin sending website lead events to Driftrock you can:

  1. Implement Conversion API integrations on all the major ad platforms at once. 
  2. Track & analyse website leads through to vehicle purchase and other actions.
  3. Connect Google Ads and other ad platforms to understand the keywords and ads that drive vehicle sales from website visits.

Below we explain how to start sending website events to Driftrock to enable all three solutions with a single implementation.

What does the Driftrock Website Events script do?

The Driftrock script will fire when a user lands or completes a defined action on your website, such as submitting a lead form. The script will capture any click ID information about that user, such as a Google Click ID or Facebook Click ID.

This Click ID information can be used to attribute these actions back to your marketing campaigns. Driftrock lets you do this by passing these Click IDs into ad platforms using the Conversions API for each system.

You can define which events you want to track with the script, and which events you want to pass into ad platforms using the Conversions API. The more events you capture and send, the more signals you’ll have to optimise your campaigns, without the need for 3rd party cookies like the Facebook Pixel.

How to start sending website events to Driftrock

1. Create a Website Events capture

Website Events is a Driftrock ‘capture’ that can receive lead or event data from virtually any source that allows you to make a HTTP request to an API.

1. Login to Driftrock

2. Go to the Conversion Tracking via the left navigation.

3. Find the Website Events capture & click Setup.

4. In the capture setup wizard, enter a value to name your Website Events capture, e.g "Website Leads" & press Next Step.

5. Select how you would like to implement the Driftrock Website Events script. This can be done either via Google Tag Manager, or a Custom implementation.


  • TIP: We recommend creating a new API key for website data in case this needs to change in the future or be disabled quickly without disrupting other sources.
  • Once you’ve selected the Key, the instructions below will dynamically update with this key to save time.


6. Once you have selected your implementation method, follow the instructions on how to add the script your website.

Ensure a compliant solution (Privacy, e.g GDPR)

You must ensure that you have your website visitor’s consent, before the Driftrock script can fire. You should control this by using cookie opt-in consent, e.g. typically via an existing banner notification requesting visitors to “Accept Cookies”.

Driftrock uses a 1st party script that will help manage website data in your own environment. 

To do this in Google Tag Manager, make sure you:

  • Have a Trigger that is triggered on the pages when the users have given cookie consent.
  • Use this Trigger to fire the Tag that you’ve created to install Driftrock script.

3. Setup your website to track events

Once you have put in place the Driftrock Website Events script, the next step is to add a piece of code which will be used to track specific events.

You can capture relevant customer behaviours like:

  • Product configuration
  • Requesting a test drive
  • Loading a review of a particular product
  • Completing a lead form

Typically these behaviours are triggered by user activities such as:

  • User clicked on a link
  • User submitted a form
  • User loaded a page

Again, depending whether you are running Google Tag Manager or not you can track these user interactions in different ways.

Capturing form submission data

With the Driftrock Website Events script you can also capture form submission data.

Without GTM

You will need to intercept the submission event of the form and call the Driftrock script by passing the form fields as well. Here is an example:

var form = document.querySelector('form');  
form.addEventListener('submit', function (e) {
var form_fields = Object.fromEntries((new FormData(form)).entries());    
Driftrock.track_event("Form submission", {fields: form_fields});  

If the above solution is not viable, the only other option is to actually intercept the form submission on the backend side. In this case Driftrock can still help you. The only difference is that instead of executing a javascript instruction on your frontend you just need to make an api call from your backend. Speak to Driftrock support to get this setup.

With GTM

If you want to capture lead submission data in Google Tag Manager you need to:

  1. Create a page load trigger


  1. Create a tag

Add the following snippet:

var form = {{Form Target}}; 
var form_fields = Object.fromEntries((new FormData(form)).entries());
Driftrock.track_event("Form submission", {fields: form_fields});

4. Generate a test event from your website

After installing and configuring the Driftrock script on your website, generate an event you wish to track. For instance, if you configured the Driftrock script to track clicks on the “Book a test drive” button, go to your website and press the “Book a test drive” button. This will trigger the event and the capture that we’re setting up will receive it, in this way we can be sure the script setup is correct and everything is working as expected.

5. Check the setup is correct and finalise the capture setup

Go back to the Driftrock app and resume the Website Events setup from step 1. If the test event was successfully received, Driftrock will allow you to proceed to the data mapping step, where you will tell Driftrock what data you're sending, and the automations you want to put in place with this data.

TIP: You can complete the capture setup without adding any Automations to start collecting data and verify your setup. Once complete you will find a log of events received and their status in the Capture Overview page.