Facebook Pixel Standart Events

Hi there

I could install the Facebook Pixel easily using a third party App (PixelMySite), but I want to track specific standard events.

In this particular case, I want to track if someone contacts. On my site, this happens either if someone presses the WhatsApp Logo in the header or in the Section Contact or if someone submits the contact form suing ContactForm 7.

The WhatsApp logo is an image item with a link.

This is the page concerned: carforest.de

According to Facebook instructions here: https://developers.facebook.com/docs/facebook-pixel/implementation/conversion-tracking

I need to add this scribt in the page <script> fbq('track', 'Purchase', {currency: "USD", value: 30.00}); </script>
I believe that I can do in the child theme, but I also need to add this scriped

<button id="addToCartButton">Purchase</button>
<script type="text/javascript">
  $('#$addToCartButton').click(function() {
    fbq('track', 'Purchase', {currency: "USD", value: 30.00});
  });
</script>

This comes with the bottun. But in my case it is a image that has a link and a contact form 7.

How can I install this pixel event ?

Best regards

Josef

Hello Josef,

Thank for writing in!

I have checked your site and I am seeing that you have the WhatsApp image in the header and in the contact form. It is using the same element ID which is not valid. An element ID must be unique within the page. If you insert the element more than once, then it is much more advisable to use the element class instead. Kindly edit your page and remove the pixelcontact as an element ID. Use it as an element class instead and then in your custom JS code, it must look like this:

<script type="text/javascript">
  $('.pixelcontact').click(function() {
    fbq('track', 'Name of your leads');
  });
</script>

It is best that you check out this thread:

By the way, for tracking the Contact Form 7 form submission, you might want to check this out:

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.