Validating Your Data Layer: Errors, Warnings, and Info Codes

Overview

When validating your own Data Layer following this guide, our debugger tool tries to alert you of as many issues as possible so that you can proactively address them. While the tool doesn't cover all scenarios, when purchasing our Headless Audit, an Elevar Analyst will manually review your Headless data layer and help you address scenarios that our Debugger tool did not alert you of.

There are three types of codes that will appear from the Debugger:

  • Error - These will be red in color. They alert you of definite issues. (e.g. duplicate events occurred).
  • Warning - These will be yellow in color. They will warn of potential issues (e.g. Consent Mode is enabled, but we haven't received consent values).
  • Info Codes - These will be gray in color. They share information about the event (e.g. this event passed validation).

Below is an overview of what each error code means and how you can address the issue.


Error Codes

BAD_EVENT_DATA:

What does this mean?: This could mean any of the following issues are occurring:

  • An empty string is passed when a value should be populated.
  • The image property in the products array does not start with a protocol.
  • The product_id or variant_id values are not stringified numbers only.

How do I fix this?: Ensure that the required properties populate and are formatted correctly. The error in the browser will give you information on what validation failed.

BAD_EVENT_ORDER:

What does this mean?: This means one of the following events was not immediately proceeded by a dl_user_data event:

  • dl_view_cart
  • dl_purchase
  • dl_view_search_results
  • dl_begin_checkout

Note: Can not validate against dl_view_item, dl_add_to_cart, dl_remove_from_cart, dl_view_item_list, dl_select_item, dl_add_shipping_info, and dl_add_payment_info as there are scenarios where these can fire without being immediately proceeded by a dl_user_data.

How do I fix this?: Make sure a dl_user_data fires first upon a page change.

DUPLICATE_EVENT:

What does this mean?: This means two identical non-user-data events fired with no context push between them. An identical event refers to all non-generated properties (generated properties include event_id, event_time, and event_state) being the same between two events.

Issues with the dl_user_data event will be captured by the MISSED_CONTEXT_INVALIDATION error.

How do I fix this?: Remove any duplicate data layer events. (E.g. if two dl_view_item events fire when first viewing a product page, update the code so that only one event fires).

CART_RECONCILIATION_ENABLED:

What does this mean?: This only triggers if the Custom Pages script (the code from our Non-Shopify Subdomain Source) loads on the webpage. This means we've checked the Elevar config script and see that the Cart Reconciliation Event is enabled.

The Cart Reconciliation Event uses logic based upon page changes when a re-load occurs, but with a Headless website, page changes do not require a page to load. This can cause incorrect dl_add_to_cart events to fire. The best practice is to keep this event disabled if the website is Headless.

How do I fix this?: In your Elevar Account > My Tracking > Shopify Source > GTM & Events Step > Make sure the Cart Reconciliation event is disabled.

Step 1 screenshot

MISSED_CONTEXT_INVALIDATION:

What does this mean?: This means we saw two dl_user_data events fire without a context push in between them. It's important to fire context pushes between page changes so that the future events use the page data (e.g. page URL, page title) of the new page rather than the previous page.

How do I fix this?: Fire this utility when route changes occur.

MISSING_GOOGLE_TAG_MANAGER:

What does this mean?: This means we did not see Google Tag Manager code loading on the website. We check this by waiting 15 seconds and then looking to see if window.google_tag_manager returns as undefined or not. If it returns as undefined, this error is triggered.

How do I fix this?: Make sure you've added Google Tag Manager code to the website following this guide.

TRANSFORM_FN_ERROR_THROWN:

What does this mean?: This means you are using our Transform Function to customize an existing Elevar data layer event, but the function you provided is throwing an error.

How do I fix this?: Make sure you are correctly using the transform function.

TRANSFORM_FN_BAD_RETURN:

What does this mean?: This means you are using our Transform Function to customize an existing Elevar data layer event, but the value you are providing is not in the correct format. (e.g. you are returning a number when it should be an object).

How do I fix this?: Make sure your customization passes data following the formatting noted here.

USERID_FN_ERROR_THROWN:

What does this mean?: This means you are using our User ID Function to pass your own custom User ID, but the function you provided is throwing an error.

How do I fix this?: Make sure you are correctly using the User ID function.

USERID_FN_BAD_RETURN:

What does this mean?: This means you are using our User ID Function to pass your own custom User ID, but the value you provided is not in the correct format. (e.g. you're returning a number when it should be a string for the User ID).

How do I fix this?: Make sure the User ID you're passing is formatted as a string.

UNEXPECTED:

What does this mean?: This means there was an error with the event that does not fall into any of the above categories.

How do I fix this?: Reach out to our Support Team with the exact error message.


Warning Codes

CONSENT_CHECK_LIMIT_REACHED:

What does this mean?: This means that Elevar’s code waited 15 seconds but still did not receive any consent values from your Consent Management Platform. This error can occur on regular Shopify stores as well.

How do I fix this?: Make sure your Consent Management Platform is passing the required consent values to Google Consent Mode following this guide.

LOCAL_STORAGE_ACCESS_DENIED:

What does this mean?: This means our script could not access local storage. We use local storage to store attribution and cart information.

How do I fix this?: Make sure local storage is enabled in your browser.


Info Codes

VALIDATION_PASS:

What does this mean?: This means the debugger tool found no issue with the event.

Is there an action I need to take?: No!

WEB_PIXEL_LOG:

What does this mean?: This means the shopify-pixel-mode local storage value is set to verbose. This setting allows debug logs for Elevar's App Pixel, which is used for attribution handling.

Is there an action I need to take?: No!

CONTEXT_PUSHED:

What does this mean?: This means the debugger tool noted that a context push was triggered.

Is there an action I need to take?: No!