Skip to content

Increase GTM head tag priority to ensure it loads before all CSS and JS - #139

Draft
gabiudrescu wants to merge 1 commit into
stefandoorn:masterfrom
gabiudrescu:claude/update-head-tag-placement-011CUKCC99zRjRwRZePP6NWW
Draft

Increase GTM head tag priority to ensure it loads before all CSS and JS#139
gabiudrescu wants to merge 1 commit into
stefandoorn:masterfrom
gabiudrescu:claude/update-head-tag-placement-011CUKCC99zRjRwRZePP6NWW

Conversation

@gabiudrescu

Copy link
Copy Markdown

Changed the priority of the GTM tag in the head section from 100 to 10000. This ensures the Google Tag Manager container code is placed at the very beginning of the tag, before any CSS or JavaScript files, following Google's best practice recommendations for GTM implementation.

Generated with Claude Code

Attempt to fix #138

Changed the priority of the GTM tag in the head section from 100 to 10000.
This ensures the Google Tag Manager container code is placed at the very
beginning of the <head> tag, before any CSS or JavaScript files, following
Google's best practice recommendations for GTM implementation.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@gabiudrescu
gabiudrescu marked this pull request as draft October 20, 2025 21:59
@stefandoorn

Copy link
Copy Markdown
Owner

I don't think this will place it before the CSS - have you tested it?

    {% block stylesheets %}
        {{ sylius_template_event('sylius.shop.layout.stylesheets') }}
    {% endblock %}

    {{ sylius_template_event('sylius.shop.layout.head') }}

I think we include this code at the second event in that snippet.

In the base Sylius shop layout (in 1.14 at least) there don't seem to be events available higher up within the head - and that would be what we need I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag location

3 participants