Skip to content
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

Google Analytics Tracking Code cached by Varnish if Cookie Restriction Settings are active #6441

Closed
bka opened this issue Sep 1, 2016 · 2 comments
Assignees
Labels
bug report Component: Framework/Cache Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Release Line: 2.1

Comments

@bka
Copy link
Contributor

bka commented Sep 1, 2016

This one is related to #5596. After working around this issue we discovered a problem when using varnish as a full page cache.

Preconditions

  1. Tested on Magento 2.1 CE

Steps to reproduce

  1. Enable Varnish Cache
  2. Enable Cookie Restriction Mode under General->Web->Default Cookie Settings
  3. Enable Google Analytics under Sales -> Google API
  4. Visit Store Front
  5. Accept Cookies

Expected result

  1. Tracking Code should be present in DOM

Actual result

  1. Tracking Code is not present in DOM, because it was cached by Vanished

Discussion

We think the block google_analytics should be declared as non-cachable. This part should be fetched as an ESI block because it depends on Cookie Restriction Settings and my confirmation to allow cookies. You will not see this behaviour with Magento built-in cache.

auswahl_043

This is, what should happen. Analytics script should be fetched as ESI block when using Varnish to avoid this problem:

auswahl_054

@ishakhsuvarov
Copy link
Contributor

Reopening, as fix for 2.1 is not implemented yet.

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-69374

@magento-engcom-team magento-engcom-team added Release Line: 2.1 Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Framework/Cache develop Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line labels Sep 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Framework/Cache Fixed in 2.1.x The issue has been fixed in 2.1 release line Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Release Line: 2.1
Projects
None yet
Development

No branches or pull requests

5 participants