Support » Plugin: EMC2 Popup Disclaimer » I am trying to track the "agree" link

  • usascholar


    I am using Slimstat plugin (

    and I was trying to attach it’s tracking function to the “agree” button on the popup, so that it can record the IP of people agreeing to the terms.

    The Slimstat says it works by adding the javascript function to the onclick event of a link, (see the faq here:

    I am trying to do this and make it work, however, it appears I get a server error when I try to add it to the “emc2pdc-admin.php” file, at this location:

    echo '<p class="linkwraps"><a class="fancybox agree" href="#">'.$settings['accept_text'].'</a> <a class="fancybox disagree" href="'.$settings['redirect_url'].'">'.$settings['decline_text'].'</a></p>';

    I am changing the code as such:
    echo '<p class="linkwraps"><a class="fancybox agree" href="#" onclick="if(typeof ss_track == 'function') ss_track(event, 5, 'User Agreed To Clickwrap Privacy Policy And Terms And Conditions');">'.$settings['accept_text'].'</a> <a class="fancybox disagree" href="'.$settings['redirect_url'].'">'.$settings['decline_text'].'</a></p>';

    Can you help to see if there is something I may be missing?

    Thank you 🙂

Viewing 1 replies (of 1 total)
  • Plugin Author Eric McNiece


    A couple of ideas.

    Syntax looks fine, but sometimes you don’t catch it until it’s throwing errors. Can you link to your site, or post the error you’re getting?

    The only other thing that comes to mind would be an enqueue conflict where the scripts load at the wrong times. Even then, it’s an onclick event… so yeah, I’m not really sure.

    Link/error please!

Viewing 1 replies (of 1 total)
  • The topic ‘I am trying to track the "agree" link’ is closed to new replies.