• Agnes

    (@agneslesagegmailcom)


    I have set up the plugin with the hope to avoid google analytics cookie to be set up prior acceptance. unfortunately, and although I have ticked “auto block”, GA cookie is coming… What is wrong? I noticed someone said this feature does not work anymore.
    I am using WP 4.5.2 and GA by Yoast plugin (now MonsterInsight)

    https://wordpress.org/plugins/eu-cookie-law/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Agnes

    (@agneslesagegmailcom)

    PS: sorry, I had not read FAQS that explainjs:
    I need to put this:

    if ( function_exists('cookie_accepted') && cookie_accepted() ) {
        // Your code
    }

    Any way to make it compatible with GA plugin?

    Plugin Author Marco Milesi

    (@milmor)

    Hi,
    you should place your GA code directly in the theme, or if you have a plugin that support custom edit of ga code, you can use or placeholders to exlude it.

    Thread Starter Agnes

    (@agneslesagegmailcom)

    Thanks for the response.
    If anoyone knows a plugin that does support custom edit of ga code, I’d be glad to know.

    in the meantime, I found it works using DuracellTomi Google Tag Manager plugin to call Google Tags (including GA) conditionnally, with this small edit after the body tag that combines instruction of both plugins, :

    if ( function_exists('cookie_accepted') && cookie_accepted() )
    { if ( function_exists( 'gtm4wp_the_gtm_tag' ) )
    { gtm4wp_the_gtm_tag(); }
     }

    Thanks:)

    Thread Starter Agnes

    (@agneslesagegmailcom)

    Sorry, I have one doubt:
    If I use the above function, that activates Google Tag Manager and GA only when cookies are accepted, then GA can’t be activated as soon as the user accepts the policy, right?
    Any idea of a workaround..?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Autoblock function does not seem to be working’ is closed to new replies.