How do I fire an event tracking snapchat pixel when a user clicks a button? I was able to successfully figure out the facebook pixel using the following code:
wixWindow.trackEvent("CustomEvent", {
event: "CompleteRegistration",
});
I added the Snapchat PAGE_VIEW pixel to the header using Tracking Tools but can’t do the same for the SIGN_UP pixel as this only needs to fire when a user clicks a button.
I had to do the same with a facebook pixel and that worked using the code above. I tried to do the same by creating a custom SIGN_UP event as shown below but instead of triggering the Snaptchat pixel, this triggered a SIGN_UP event on the Facebook pixel (I am using the Snapchat and Facebook pixel chrome extensions to validate this)
wixWindow.trackEvent("CustomEvent", {
event: "SIGN_UP",
});
The Snapchat documentation tells be to add the following code to the button:
<!-- Snap Pixel Code -->
<script type='text/javascript'>
(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
r.src=n;var u=t.getElementsByTagName(s)[0];
u.parentNode.insertBefore(r,u);})(window,document,
'<link that i had to remove as corvid does not allow links>');
snaptr('init', '<my_pixel_id>');
snaptr('track', 'SIGN_UP');
</script>
<!-- End Snap Pixel Code -->
This seemed to be very similar to the facebook pixel instructions so I tried to do what worked for me with the Facebook event pixel. However that didnt work.
Is there a way for me to fire the Sign_up pixel only when a button is clicked?