New Member
1 0 0

Hi all,

I have encountered an issue with a custom dataLayer which refuses to load on all collection pages. What I've found so far is that on those pages, window.jQuery returns undefined (while the dataLayer waits for jQuery to load).

I've tried adding the following

{{ '//' | script_tag }}
{{ 'api.jquery.js' | shopify_asset_url | script_tag }}

and this loads the jQuery library, but still doesn't execute the dataLayer. The dataLayer is contained in a snippet and accessed from the <head> of the theme.liquid file.

{% include 'dataLayer-allPages.liquid' %}

The custom dataLayer documentation can be found here:


Here is an example where the dataLayer doesn't initialize:

Here's an example where it initializes correctly:


Any help will be greatly appreciated!

Thank you,