Hey everyone!
So I have a problem with the facebook pixel button event. I followed this lesson and also made some research. I want to see, if people use my C2A button on my frontpage.
I’ve managed to set up the page view event and a event, when people view my page more than 10 seconds. At least they seem to work.
Now here’s the code for my button click event:
<script type="text/javascript">
var button = document.getElementById('getintouch');
button.addEventListener(
'click',
function() {
fbq('track', 'GetInTouch-Button');
},
false
);
</script>
In the browser (chrome) I get the following error message: Uncaught TypeError: Cannot read property ‘addEventListener’ of null at deepnoise.studio/:78
But I got no clue how to fix it, because it seems like I followed all the steps shown in the webflow lesson. The ID from my button is ‘getintouch’, added in the ID field.
Here is my published site: deepnoise.studio
Can anybody help me with my problem? Thanks in advance!