• ceriseduweb

    (@ceriseduweb)


    Dear Support,
    I would like use the function for disable code like Google analytics or Google maps.

    if ( function_exists(‘cn_cookies_accepted’) && cn_cookies_accepted() ) {
    // my adsense code here ?
    }

    How to use this function?

    Thank you !
    Regards,
    Cerise

    https://ww.wp.xz.cn/plugins/cookie-notice/

Viewing 1 replies (of 1 total)
  • Hi Cerise,

    Depends on how you activate Google Analytics? You should place the activation within the if block you mention:

    if ( function_exists('cn_cookies_accepted') && cn_cookies_accepted() ) {
     // Code to activate GA
    }
    

    If you use a plugin or a theme to insert GA code, then you need to find out how to disable the activation conditionally. Either check plugin/theme code out or ask plugin/theme developer for help.

    Cheers,
    Česlav

Viewing 1 replies (of 1 total)

The topic ‘Disable G.Analytics function’ is closed to new replies.