Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Trying to activate "event tracking" on "buy now"-buttons #751342

    Hi,

    Thank you for your help. Although, I still don’t seem to get it right.

    I pasted the code to functions.php as follows:

    function ava_custom_script() {
    ?>
    <script type=”text/javascript”>
    (function($) {
    // steam button onclick attribute
    $(“.heist-steam-button a”).attr(“onclick”, “ga(‘send’, ‘event’, ‘button’, ‘click’, ‘Steam button click’, opt_value, {‘nonInteraction’: 1})”);
    })(jQuery);
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘ava_custom_script’);

    Also, I changed the onclick attribute to now say “heist-steam-button”.

    As you can see, I matched the event parameters with those of the created goals in Google Analytics. Am I still missing something?

    Thanks in advance.

    Rasmus
    Image & Form

Viewing 1 post (of 1 total)