• Resolved extes123

    (@extes123)


    Hi,
    the plugin message works like a charm but the important part isn’t working.

    Im trying to use google analytics code inside the ‘code after accepting cookies’ area oder inside the side via ‘cn_cookies_accepted()’. But both methods are not working, because cn_cookies_accepted is not defined. If I call this method from the browser console I’m just getting a undefined. What’s the trick in using this feature? Even a ‘window.alert(“Test”);’ isn’t working in the ‘code after accepting cookies’ area in the plugin settings. Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dFactory

    (@dfactory)

    Hi,

    There are two things that needs explanation:

    1. cn_cookies_accepted() is a PHP, not javascript/jquery function and it’s intended to use in your theme php files (that’s why the console says cn_cookies_accepted is undefined)

    2. The code you’re trying to use will not accept javascript code if it’s not wrapped with <script></script> tags.

    Please do the adjustments and try again.

    Thread Starter extes123

    (@extes123)

    Thanks for the explanation! Now everything is working.

    Maybe it would be usefull to add these both explanations to the plugin settings site somewhere.

    I have the same question, could you enlighten me on where you placed that code and formatting, Extes123?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘cn_cookies_accepted() ois undefined’ is closed to new replies.