Hi!
I’ve inserted a whatsapp link on a website and I want to track the clicks on it as an event on analytics.
What I did:
1) Enabled the ALB. The element has nos a CSS class called whats1
2) In functions.php inserted this code
unction ava_custom_script() {
?>
<script type=”text/javascript”>
(function($) {
// steam button onclick attribute
$(‘.whats1 a’).on(‘click’, function(e){ ga(‘send’, ‘event’, ‘web’, ‘whatsapp’, ‘mensaje’); });
})(jQuery);
</script>
<?php
}
add_action(‘wp_footer’, ‘ava_custom_script’);
3) Created the event – goal in analytics, with category web, action whatsapp, label mensaje.
Nothing happens. Already read all similar posts here.
Any help?
Hey Diego,
Please, it is not included in our support scope, you need to hire a freelancer to accomplish this.
Best regards,
John Torvik