Support » Plugin: Cookie Notice for GDPR & CCPA » GADWP: Adding javascript:gaOptout() to Cookie Notice doesn’t work

  • Hi

    i would like to add a opt-out link in the cookie notice text field.

    <a href="javascript:gaOptout()">Click here to opt-out of Google Analytics</a>

    But this gets stripped to <a href=”gaOptout()” ……

    Any way to enter a Link like this to the Cookie Notice?

    The OPt-Out link is provided by the Plugin Google Analytics Dashboard for WP (GADWP)

    • This topic was modified 1 year, 7 months ago by Svensonsan.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Following as I have a similar question.

    Plugin Author dFactory

    (@dfactory)

    You have 2 options.

    1) we’re using esc_textarea function for the message text, so you can try checking if it’s possible to filter allowed content and extend it with javascript

    2) better: put a unique tag into href like <a href="%%gaoptout%%"> then use cn_cookie_notice_output filter hook to replace %%gaoptout%% with javascript:gaOptout()

    • This reply was modified 1 year, 7 months ago by dFactory.

    Thank you for your answer. I was very curious to read it, but maybe I am too stupid.

    Where do I put the cn_cookie_notice_output filter hook and how do I replace %%gaoptout%% with javascript:gaOptout()?

    Thank you in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘GADWP: Adding javascript:gaOptout() to Cookie Notice doesn’t work’ is closed to new replies.