facebook-for-woocommerce
facebook-for-woocommerce copied to clipboard
Placeholder for events through Ajax is always triggered
- [X] I have confirmed this occurs in the most recent version of WordPress, WooCommerce, and Facebook for WooCommerce.
- [X] I have confirmed this occurs when only WooCommerce and Facebook for WooCommerce are active and when using a default WordPress or WooCommerce theme.
βοΈ Describe the bug
In file location facebook-for-woocommerce/facebook-commerce-pixel-event.php
<!-- %s Facebook Integration Begin -->
%s
<script>
%s
fbq( 'track', 'PageView', %s );
document.addEventListener( 'DOMContentLoaded', function() {
jQuery && jQuery( function( $ ) {
// insert placeholder for events injected when a product is added to the cart through Ajax
$( document.body ).append( '**<div class=\"wc-facebook-pixel-event-placeholder\"></div>**' );
} );
}, false );
</script>
<!-- DO NOT MODIFY -->
<!-- %s Facebook Integration end -->
##πΆββοΈ Steps to reproduce
The placeholder <div class="wc-facebook-pixel-event-placeholder"></div>
is always visible in the body tag no matter if Ajax "Add to cart" button is clicked or not.
Make sure that when Ajax is used that add to cart event is working properly by fixing this bug.
βοΈ Expected behavior
This placeholder <div class="wc-facebook-pixel-event-placeholder"> should only be triggered when adding product to cart via Ajax and "AddToCart" event should be triggered.
Hi there @engineerized - thanks for reporting. Based on your description, I don't see an issue here - that <div>
should not trigger any events, it looks like a placeholder.
If you're seeing a bug relating to this, please add more details so we can reproduce:
- Detailed steps for how to reproduce the issue.
- What you expected, and what you saw - i.e. details of the bug behaviour.
- Bonus points: how this impacts your store/business, or what you are trying to do.
Thank you π
Based on hazsari comments. I am closing this.