Jump to content

Setting Up Facebook Events For Two Different Buttons

Recommended Posts

Site URL: https://www.myofascialmississauga.com/clinic-reopening

Hi everyone, 

I currently have two buttons on this landing page myofascialmississauga.com/clinic-reopening and i'm looking to implement a facebook pixel to fire two different events for each of the pixel. 

The Number to track - Contact conversions

The Book Now to track - Schedule

Currently I have a code implemented as such: 

<script>
    window.Squarespace.onInitialize(Y, function() {
        var btns = document.getElementsByClassName("sqs-block-button-element");
        var i;
        for (i=btns.length-1; i>=0; i--) {
            btns.addEventListener("click", function() {
                fbq('track', 'Contact');
            });
        }
    });
</script>

 

But how would i append the script to capture fire specifically for the number only and also a separate on to fire for the "book now" to track Schedule. 

 

Thanks so much.

Screen Shot 2020-05-28 at 8.51.26 AM.png

Link to comment
  • Replies 0
  • Views 787
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.