Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Tracy Levesque

    (@liljimmi)

    ?????? YIKES, Inc. Co-Owner

    Hi Nelson.

    Adding JS is not something you would do via our plugin, you would need to enqueue it in your theme.

    Here is documentation on how to do that: https://developer.www.ads-software.com/reference/functions/wp_enqueue_script/

    Thank you!
    -Tracy

    Hi Tracy,

    I’m also interested in firing a Google Analytics event upon form submission and, frankly, am surprised that this feature isn’t requested more often.

    I’m familiar with enqueueing scripts in WP, but I’m curious what you would recommend for injecting the GA code. My first thought is to use the jQuery .submit() handler to intersect the form submission. Here is my code:

    $( "#footer-1" ).submit(function( event ) {
      var userEmail = $(".yikes-easy-mc-form input[name=EMAIL]").val();
      ga('send', 'event', 'Newsletter', 'Sign Up', userEmail);
      return true;
    });

    I believe this will work, but am curious if your plugin offers something more integrated. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Google Analytics code integration’ is closed to new replies.