- Issue created by @marcelovani
There is an option to allow the user to decide if they want to opt in/out of the scripts.
When this option is enabled, there is a field in the user page that allow the user to change the value and decide.
The problem is that the condition is being evaluated in the back end and by setting cache contexts per user, it means that we will have user ids on the cache tags of every page that has the VWO scripts.
This is bad for performance because it will cause a log of cache misses.
Every time an authenticated user visits a page, an entry of user id will be added to the cache tags.
If one user changes their view options, every page that is tagged with that user will be flushed.
This is bad for large sites that have large number of articles and users because the cache tags will be massive.
Part 1: We need to stop adding cache tags in the back end. Ideally this could be done in one of the following methods:
Part 2: We need to update the bootstrap script to check the user personal option first, before sending any data to VWO. The script can still be on the page, but no data will be sent if the user decides not to. See code https://git.drupalcode.org/project/vwo/-/blob/8.x-1.x/vwo.module?ref_typ...
Make sure the code is compatible with Drupal 11
Active
1.0
Code