Debugging Deviate Tracking

Debugging Features

Here at Deviate Tracking, we strive to be responsive to user feedback. That’s why we’re introducing two new features meant for advanced users: debug mode and testing mode. Both features are enabled through the presence of their respective query parameter.

These are advanced features. If you don’t know what a query parameter is, or you aren’t comfortable with devtools, you should not use these features. Used correctly, these features can cut hours off your development time — used incorrectly, they can break your tracking or compromise your website’s security.

 

Debug Mode

The first new feature is debug mode. Debug mode is enabled by adding dtdebug=true to your URL’s query parameters. It causes Deviate Tracking to log out information about its internal workings, including:

 

  • tag settings
  • the exact data sent via Facebook Pixel or the DT API
  • your DT API key
  • whether a tag is waiting for another
  • and much more

It should be clear from the list above why permanently enabling debug mode would compromise security. Additionally, it is generally considered a bad idea to use console.log in production. However, this information is quite useful when debugging your Deviate Tracking installation. If you’re a power user who prefers to solve their own problems, crack open devtools sometime and take a look.

 

Test Mode

The second new feature is test mode. Test mode is enabled by adding dtTestCode=<FB test code here> to the URL’s query parameters. You can get a Facebook test code by going to Events Manager and then selecting the Test Events tab at the top.

Enabling test mode causes Deviate Tracking to send all events with the test code. Notably, test mode will override the Test Event Code field in all Deviate Tracking tags on the page — this is intentional. With test mode, you no longer have to manually set the test code in every tag, and it’s much harder to forget to remove the test code when you’re done testing.

We have no plans to remove the Test Event Code field at this time.

 

Best Practices

To minimize risk, avoid sharing URLs with debug mode or test mode enabled. We understand that you may want to share the URL with your engineering team — that’s fine. However, you should never post a debug or test mode URL on a public website. Imagine if that was the URL that went viral and none of the traffic was counted.

If you’re not an advanced user, we recommend avoiding debug mode and test mode altogether.

Be Sure to Turn Off “Test Events” to Avoid the “Missing Deduplication” Issue

 

Recently, Facebook made some backend changes to the Graph API which impacts how they handle the flag for test events. When tests events are ‘on,’ this causes the “missing deduplication” issue inside Facebook Events Manager.

 

As such, it is vital moving forward that whenever you’re done testing events, that the “Send as a Test Event?” box is unchecked within Deviate Tracking tags in your GTM production environment (e.g. when you are done testing). 

 

 

And if you left this box checked in your environment, it may take 48 hours after unchecking these boxes for Facebook to stop reporting it as an error.

 

We encourage you to only use the Test Event flag when you are using GTM’s preview mode and ensure that these “Send as a Test Event?” checkboxes are off when when you publish their GTM containers.

 

Test Event Recommendations

 

We still recommend testing your tags to ensure that Facebook’s Events Manager is receiving data properly, just insure that you are using the Preview feature of tag manager, or if you enable it that you remember to disable it in your production environment when you are finished testing.

Interested in trying Deviate Tracking? Start your free trial today.