Comments

5 comments

  • Avatar
    Peter Vukadinov

    Do you use some GDPR related extension? If yes check if the URL is stripped when you accept tracking cookies.

    0
    Comment actions Permalink
  • Avatar
    Mitxel Moriana

    Hello Peter, thanks for your reply.

    You were right! There is an Amasty GDPR module running a Plugin after rendering that strips away the tag manager URL.

    Quite impressive stuff, if you ask me.

    In case it helps anyone else, I modified the snippet code slightly so the regex expression of the Amasty module does not "match" the URL snippet, and leaves it alone. Something like:

    ...url = 'https://...' + i + dl;

    changed to:

    ...url = 'h' + 'ttps://...' + i + dl;

    (i.e. added a trivial concatenation so the regex /\'https:.../is/ fails to match.
     


    0
    Comment actions Permalink
  • Avatar
    Peter Vukadinov

    That was my problem too -  Amasty GDPR.

    Realistically, this is not a problem but an expected behavior in the context of the GDPR. We must not track users without their express consent.

    There is a solution without changing the code. Through the administration of Amasty GDPR, the cookie (_ga) must be marked as essential. But the GDPR problem remains :-)

     

    0
    Comment actions Permalink
  • Avatar
    Mitxel Moriana

    I agree with you. I suspect the inconsistencies (users with all cookies accepted having the tag manager disabled in some pages) are probably due to full page cache layer (e.g. varnish) serving the same html version to customers with different Amasty module-related cookie values, so it is entirely possible that Amasty module is running as expected and the bug is caused by the combination of Amasty mod + full page cache.

    0
    Comment actions Permalink
  • Avatar
    Peter Vukadinov

    Yes, full page caching is often a problem. I assume there are mechanisms to manage it correctly, but not all vendors do.

    0
    Comment actions Permalink

Please sign in to leave a comment.