Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #664013

    Dear friends,

    I created an objetive on Adwords. So I have to introduce the following info into a button in my page (Enfold Theme).

    >> onClick=”ga(‘send’, ‘event’, ‘button’, ‘click’);”

    How Can I fix that? I can’t add any code to the button.

    Thanks

    #664018

    Hi agustinrosa!

    Please turn on custom CSS field for ALB elements – http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and then edit your button and then give it a custom CSS class and then add following code to functions.php file of your child theme in Appearance > Editor

    function custom_button_attr(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.your-custom-button a').attr("onClick","ga('send', 'event', 'button', 'click');");
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'custom_button_attr');

    Best regards,
    Yigit

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.