Installing Deviate Tracking

Before adding any tags using Deviate Tracking, you need the following four items. Save them as GTM variables to avoid having to copy and paste them each time you create a tag.

Pixel ID

The pixel ID indicates which pixel Deviate Tracking should send data to. You can get it from inside Facebook Events Manager at the top right of the Overview tab.

Facebook Pixel ID
Pixel ID location

Facebook Access Token

Deviate Tracking uses the access token to prove that it has permission to send data to your pixel. You can get it from insideFacebook Events Manager. Go to the Settings tab, then scroll down to the Conversions API section. Click the link titled Generate access token and then copy the text it produces.

How to generate a Facebook access token
Facebook Access Token location

License Key and Email

Your license credentials are in your subscription’s confirmation email. If you can’t find it, try searching for emails from [email protected] or checking your spam.

A confirmation email

Creating Variables

You should save these four items as variables in Tag Manager. Click on the Variables tab on the left, then choose the Constant variable type. This might seem like a hassle, but it will save time in the long run.

Deviate Tracking GTM Variable
Creating a Tag Manager variable

Update CAPI User Access

Before moving forward, you need to grant “Conversions API System User” the proper access to your pixel. Visit Events Manager and go to Users -> System Users.

You should see a new user called Conversions API System User. This user is automatically generated along with your access token. Click the CAPI user to open up the Assigned Assets screen. Make sure that Manage Pixel is highlighted, then click Save.

Facebook Conversions API system user
Facebook Conversions API System User

Import Deviate Tracking

Head on over into your Google Tag Manager and enter the appropriate container. On the left, click Templates, then Search Gallery and search for Deviate Tracking. Click the top result and add it to the workspace.

Import Deviate Tracking GTM Tag Template
Searching for Deviate Tracking
Add Deviate Tracking to GTM workspace

Create Your Tag

You are now ready to start wiring up your website with analytics. Create a new GTM tag by clicking on Tags, then on New. For Tag Type, scroll down to find Deviate Tracking.

Create GTM Tag with Deviate Tracking
Creating a tag in GTM

In the tag creation dialogue, provide a tag name and set up your triggers. You will also need to enter the four items from the beginning of this guide:

  1. Your Facebook Pixel ID
  2. Your Facebook access token
  3. Your Deviate Tracking license key
  4. Your Deviate Tracking license email

Make sure to specify a Standard Event type (check out our Match Quality guide to learn why this matters). Note that Deviate Tracking automatically sends both a browser and a server (CAPI) event. You should leave both boxes checked to maximize the chance of Facebook receiving your data.

Enter info into Deviate Tracking tag configuration
Configuring a Deviate Tracking tag

Set up Deviate Tracking pixel

You’ll want Deviate Tracking to handle your Facebook pixel so your browser and server events are synchronized. This means you need to create an extra tag. Name is “Facebook Pixel (CAPI)” and select the PageView (Facebook Pixel) Standard Event type. Set the trigger to All Pages and save the tag.

Deviate Tracking CAPI Facebook Pixel

You can now delete your legacy Facebook pixel code. It may have be in a Custom HTML tag, or injected into your head element through a plugin or site configuration setting.

Note: If you do not delete your legacy pixel code, Deviate Tracking will not function correctly. We are aware of this shortcoming and a fix is on our roadmap.

The last step is to test that your Facebook pixel is set up correctly. Install the Facebook Pixel Helper extension and navigate to your website. Click the Facebook Pixel Helper icon in your browser’s top bar and you should see that it shows a PageView event.

Congratulations! You are now ready to create any other tracking tags. Don’t forget to publish your GTM container when you’re finished.