Skip to content

Commit

Permalink
Merge pull request #9 from IvoElgentos/dataLayer-fix-and-extra-config…
Browse files Browse the repository at this point in the history
…-checks

dataL fix and extra config checks in layout
  • Loading branch information
WouterSteen authored Jul 10, 2024
2 parents e092a1d + 77f63ba commit 5f995bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<referenceBlock name="cookie_notices" remove="true" />

<referenceContainer name="after.body.start">
<block class="Magento\Cookie\Block\Html\Notices" name="cookie_notices_content_mode_v2" template="Elgentos_ConsentModeV2::html/notices.phtml">
<block class="Magento\Cookie\Block\Html\Notices"
name="cookie_notices_content_mode_v2"
template="Elgentos_ConsentModeV2::html/notices.phtml"
ifconfig="elgentos_consentmodev2/general/enabled"
>
<block class="Magento\Cookie\Block\Html\Notices" name="cookie_banner_script" template="Elgentos_ConsentModeV2::cookie-banner-script.phtml" />
<block class="Magento\Theme\Block\Html\Header\Logo" name="cookie_notice.logo">
<arguments>
Expand All @@ -27,7 +31,11 @@
</referenceContainer>

<referenceContainer name="before.body.end">
<block name="cookie_notices_content_mode_v2_button" template="Elgentos_ConsentModeV2::html/button.phtml" />
<block
name="cookie_notices_content_mode_v2_button"
template="Elgentos_ConsentModeV2::html/button.phtml"
ifconfig="elgentos_consentmodev2/general/enabled"
/>
</referenceContainer>
</body>
</page>
2 changes: 1 addition & 1 deletion src/view/frontend/templates/cookie-banner-script.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ if (!$cookieHelper->isCookieRestrictionModeEnabled()) {
};
},

gtag(arguments) {
gtag() {
dataLayer.push(arguments);
},

Expand Down

0 comments on commit 5f995bb

Please sign in to comment.