Troubleshooting an 'Unknown' Track

When the Monetate tag runs, Monetate runs custom.js, a compiled JavaScript file with all the necessary code to execute actions and collect relevant page information. By default, this script waits until the DOMContentLoaded browser event completes and then looks for the existence of the monetateQ object on the page. If the monetateQ object is not available at that time, then the custom.js file runs its own track so that Monetate tracks the page.

'Unknown' Track Appears Before API Calls

If you see the "unknown" track before the API calls for a page, the reason is that the API method calls are most likely not firing before the DomContentLoad event. The initial track request from the custom.js script is firing before your site pushes any API method calls to the monetateQ object.

When this sequence happens, no information, such as pagetype, has been pushed to the monetateQ object, so only default values are sent when the custom.js script makes the failsafe track request. If a pagetype is not set in the monetateQ object, then Monetate intentionally returns the pagetype as "unknown" to prevent errors.

In this screenshot from the Monetate Inspector browser plug-in, the "unknown" error appears for Page Type on the Components tab.

Example of the 'unknown' error appearing for Page Type in Monetate Inspector

If you cannot update your tag management system (TMS) running the API calls to fire Monetate JavaScript API method calls before custom.js makes a trackData request, then the "unknown" track is unavoidable without moving the API calls out of the TMS. It's possible though not always advisable for Monetate's engineers to update the custom.js script to delay the initial track request and allow more time for your TMS to populate the monetateQ object.

Consequences of an 'Unknown' Initial Track

While this issue isn't the worst thing that could go wrong during an API implementation, side effects could hinder experiences from running on the right pages if they're not properly conditioned. "Unknown" tracks also skew bounce rate metrics because technically you won't bounce from the site with two tracks on the landing page. Additionally, this issue can increase the number of page views since Monetate records each track.

Flicker is one of the most prominent detrimental impacts of an "unknown" track. Because masking evaluates purely based on the URL path and is not restricted by any audience segmentation or other targeting, a mask executes when Monetate fires on the initial track request. It doesn't fire on any subsequent tracks. Therefore, masks execute immediately on the "unknown" track, but any later trackData request containing action-triggering information is executed without masking. The result is that the customer is more likely to encounter flicker in the experience than if a single trackData request has the appropriate timing.