How to track Google Analytics & Facebook Pixel Events on WhatsApp widget button click ?

Track google analytics, facebook pixel or any other event tracking tool you are using for your Shopify online store.

You can track WhatsApp Chat widget button, WhatsApp Chat button, Share bar and product share button clicks with the code given below,

 window.spWhatsAppTrack = function(buttonType){
   
   if(buttonType == 'shareButton'){
       // Your code here....
   }else if(buttonType == 'widgetButton'){
       // Your code here....
   }else if(buttonType == 'shareBar'){
       // Your code here....
   }else if(buttonType == 'productShare'){
       // Your code here....
   }
};

Insert & use this code somewhere before the tag in theme.li