-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't seem possible to conditionally load gtag #1334
Comments
Doing this: {% do seomatic.script.container().include(false) %} will ensure that no scripts from SEOmatic are rendered. Are you sure this gtag script is actually coming from SEOmatic? |
Yes, if I turn it off explicitly in the SEOMatic settings, it disappears. I know `seomatic.script.container().include(false)` is not supposed to render any scripts but it didn't work, so I added the gtag specific exclusion as well which also didn't work.
…On Fri, 16 Jun 2023 at 23:49, Andrew Welch ***@***.***> wrote:
Doing this:
{% do seomatic.script.container().include(false) %}
will ensure that *no* scripts from SEOmatic are rendered. Are you sure
this gtag script is actually coming from SEOmatic?
—
Reply to this email directly, view it on GitHub
<#1334 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFSIPLMQBCIMUZB7YMUWDR3XLTPILANCNFSM6AAAAAAZHWHLGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Addressed in: eae2cc4 & 60838de Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop as 3.4.58”, Then do a ….. Craft CMS 4: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.29”, Then do a |
FYI, I think this has caused a regression on noscript related areas for bodyJS see: #1346 since updating to 3.4.58 |
Yes, you're right. #1346 |
So I looked into this further after having to roll back the previous fix that had regressions. If you put this Twig into the root of the template (not in a
It will work for you. The issue is that the body script is rendered in a different manner than the rest of the tags, because it can include raw HTML, and due to Twig Processing Order: https://nystudio107.com/blog/twig-processing-order-and-scope ...the tags are rendered before your code that said not to include the tag is executed. Moving that code outside of the block will cause it to work as expected. |
I wasn't content with that quirk, so fixed the issue properly. Craft CMS 3: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop as 3.4.60”, Then do a ….. Craft CMS 4: You can try it now by setting your semver in your "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.31”, Then do a |
Describe the bug
Following advice given on other issues here, I have the following in my default layout:
FB Pixel, hubspot etc correctly disappear, however there is still a call made to
https://www.googletagmanager.com/gtag/js?id=xxx
Versions
The text was updated successfully, but these errors were encountered: