If you are using Cookie Notice correctly for GDPR then you have probably moved your Google Analytics script to Cookie Notice’s script blocking text box.
If your visitor has yet to accept cookies the script is not served and Google Analytics does not run. If the user then accepts cookies Cookie Notice will reload the page with GA and it executes. However Google Analytics will record a reloaded page as a direct request (like navigation within your site) instead of an organic (off-site request).
As the CCA plugin is “managing” your visitors from outside the EU, we can ensure that, for these visitors at least, GA will is always served and executed so “organic” information is not lost; and CN will still block Analytics for EU visitors until acceptance.
Its a fairly simple solution but errors in the code could break your system; so only use if you know how to delete the script outside WordPress.
Note: this solution does not work for WPSC users – I have sent a revised script to a WPSC user for testing.
1. Copy the following code:
2. Cut your GA script from Cookie Notice’s script blocking text box (image at top of page) and paste it into the code above in place of the yellow highlighted line.
3. Save as “cca_analytics_fix.php” in folder “”cca_analytics_fix” ;
4. Compress the folder into a Zip file (cca_analytics_fix.zip)
5. Ensure you have removed the GA script from Cookie Notice’s text box and saved CN settings. Then upload the zipped file via your WordPress Dashboard (
plugins->add new->upload) and activate.
If you have checked the “Reloading” option in Cookie Notice settings then the first page a new visitor lands on will be reloaded.