Facebook Pixels on click trigger function is not working .. but the page views is working already

Topic summary

A user is experiencing issues with Facebook Pixel click event tracking on their Shopify website, while pageview tracking functions correctly. The pixel is initialized across all pages, but the click trigger specifically isn’t firing.

The problem appears related to an ‘Add to Cart’ button implementation. The user has shared code showing a button element with:

  • Custom ID and classes for cart functionality
  • Data attributes for product/variant tracking
  • An onclick event attempting to trigger Facebook Pixel’s ‘AddToCart’ tracking

A screenshot has been included showing the implementation details. The code snippet reveals potential formatting or syntax issues in the button’s attributes and event handlers that may be preventing the click event from properly triggering the Facebook Pixel tracking function.

No solutions or responses have been provided yet, and the issue remains unresolved.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

I have an issue linked to my website , the tracker for on click event for pixels is not working how all pixels is initialized according to all pages .. how we can fix that

<button id=“cartHeight-{{ product.id }}” type=“button” class=“newplp-add_{{ product.id }} add-to-cart w-100 primary-button text-white quick-add-btn js-quick-add-btn” title=“{{ ‘products.product.add_to_cart’ | t }}”
tabindex=“-1”
data-id=“{{ variant.id }}” onClick="fbq(‘track’, ‘AddToCart’);addToCart(‘{{ product.id }}’, `{{ product.title | append: " " | append:product.me

tafields.descriptors.subtitle }}`, ‘{{ product.price | money_without_currency }}’">