Type: Technical Task
Affects Version/s: None
Fix Version/s: 3.0
This feature provides customers with a way to disable JS tracking conditionally, by setting a global variable. This approach is similar to the one provided by Google Analytics (see https://developers.google.com/analytics/devguides/collection/gtagjs/user-opt-out).
the JS tracking client will stop tracking user events. For example, a customer could set this variable to true initially, and wait for the user to accept the site conditions before it is set to false.
The variable is not set by default, which means the JS tracking is enabled and behaves as in previous versions of Audience Targeting.
Steps to validate:
- Install the latest version of Audience Targeting on Liferay 7.1
- Login as an admin
- Open the browser Dev Tools and monitor Network activity
- Reload any site page and assert that the Network activity monitor shows a track request with some user events
- Go to Configuration > Site Settings
- Go to the Advanced tab, go to the Analytics section and in the Piwik input, enter the JS snippet previously described, including the script opening and closing tags (see screenshot). Save changes.
- Reload any site page and assert that the Network activity monitor does not show a track request.