yireo/Yireo_GoogleTagManager2

FPC issues when cookie restriction is enabled

Closed this issue · 1 comments

When cookie restriction and full page cache is enabled in magento pages are sometimes cached without gtm code inside and then served to all users.
This happens when first time visitors open the page and therefore have cookie restriction and their visit is then cached. Subsequent visits from users that accepted the cookies are served from cache and also have no gtm.

Extension version: 1.0.1
Magento: 2.2.8

How to reproduce:

  1. Enable Full page cache (admin->system->cache management)
  2. Enable cookie restriction (admin->store->configuration->general->web->default cookie settings then set Cookie Restriction Mode to yes)
  3. Visit the in the frontend from incognito window (page A broser A)
  4. Open different page from frontend in a different browser (page B browser B)
  5. Accept cookies from cookie banner on the bottom of the page. (page B browser B)
  6. Open the first page with the second browser (page A browser B)

Expected result:
page A with browser A should have no gtm
page A browser B should have gtm

Actual result:
page A with both browsers have no gtm

Thanks for reporting this. I have now confirmed this issue and am releasing a new version.