ArthurPrnt Posted October 15, 2020 Share Posted October 15, 2020 Site URL: https://storiesone.com Hello everyone, I am struggling to add a facebook pixel event on an image link click on squarespace. On the website it is the join Discord image, that open our Discord link and I want to be able to target people that perform this action most of the time. First, I tried to use the No code facebook pixel event manager solution but it doesn't recognized the event when I click on the image. Then I tried using the code injection solution but still doesn't work. I have injected this code inspired from a stackoverflow post in the squarespace code injection header space: <script> (function() { var blockBtns = document.getElementsByClassName("sqs-block-image-link"); for (var i = 0; i < blockBtns.length; i++) blockBtns[i].addEventListener("click", function() { fbq("track", "Discord Click", { }); }); })(); </script> The result is: Just after opening the website page, I have this message on the facebook pixel helper chrome extension ( i still did not click on the Discord button) When I click on the Discord image, nothing change on the facebook pixel helper. If someone can help me solve that situation that would be awesome 🙂 thecreativechapter 1 Link to comment
thecreativechapter Posted February 14, 2022 Share Posted February 14, 2022 I can see that you've managed to sort this out. Could you be so kind to share how you did this? Struggling with the exact same issue, and can't seem to find a good solution online.. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment