Hi
I think most of cookie consent providers need something like that.
Is it possible to do this in 4SEO too?
To do this, we would need to have plugins for each cookie consent provider, of which there are many, per country, made for Joomla or not, so 4SEO cannot do that right now. But having the ability to add custom attributes to the script tag is likely a nice option, I'll think about it.
As for now, you can:
- create a "Raw content" rule (SEO Tools | SEO rules, create a rule and select Raw content as the type). This lets you inject anything you want in various positions of the page (top of head, bottom of head, bottom of body, etc). You'll have to create the entire snippet.
- do an override: anything 4SEO outputs is done through JLayouts. For instance, for Google Analytics V4, you'll override the 'default.forseo.analytics.globalga_headtop
' layout.
The original file is in /plugins/system/forseo/vendor/weeblr/forseo/layouts/default/forseo/analytics/globalga_headtop.php
- an alternative to that is to use a filter, which is like doing a layout override but in code only, without re-outputting the entire code snippet. I need to dig the details for that if a JLayout override is not convenient.
Best regards
Yannick Gaultier
weeblr.com / @weeblr