Since AFL UTM Tracker version 2.14.7, we have prepared two Javascript functions where you can use them in your code to opt-in or opt-out of cookies.
Please reach out to us by email if you need help with a specific Cookie Consent Banner.
Requirements:
- AFL UTM Tracker v2.14.7
Plugin Setting
- Login to your WordPress dashboard.
- Go to AFL UTM Tracker > Settings.
- Look for the Cookie Consent Integration section.
- Set Cookie Consent Integration: GTM / Manual
- Set Consent Category: Statistics or Marketing
- Save settings.
- Clear all page cache.
NOTE: Setting the Consent Category does not affect anything since you will be using manually calling the javascript function to opt-in or opt-out of cookies.
Javascript Functions
The following javascript file be loaded on the frontend. It is best to wait till the script has loaded before using the functions below.
/wp-content/plugins/afl-wc-utm/public/js/manual.min.js
The functions below can be used in your cookie consent banner plugins. There are usually callback function for opt-in and opt-out where you can insert the functions below.
Please check the documentation of your cookie consent banner plugin.
Opt-in
afl_wc_utm_optin();
Opt-out
afl_wc_utm_optout();