I use a plugin to display Cookie Notice and I try to block google tracking on refuse content. In the plugin description says that
USAGE: If you’d like to code a functionality depending on the cookie notice value use the function below:
if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) { // Your third-party non functional code here }
So I placed on the given box of the plugin, the following:
<script>
if ( function_exists('cn_cookies_accepted') && !cn_cookies_accepted() ) {
window['ga-disable-UA-XXXXXX-1'] = true;
}
</script>
where UA-XXXXXX-1 is my Google Analytics Id
However, I get on the console that:
ReferenceError: function_exists is not defined
I am thinking that the above code is not Javascript... (may be php ?). So I am stuck... How I proceed?