I am trying to make it so that whenever anybody clicks on a button with a specific ID this jQuery script fires the Facebook Pixel's 'Add to Cart' event. Here's the code I have so far:
// add to cart
$('#offerbutton').click(function(e){
fbq('track', 'AddToCart');
});
How can I make this script globally accessible so I don't have to go through my Wordpress website page my page to paste the code in manually?
Thanks!