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
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