Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for add to cart pixel on ajax add to cart #2

Closed
helgatheviking opened this issue Jul 27, 2017 · 5 comments
Closed

Support for add to cart pixel on ajax add to cart #2

helgatheviking opened this issue Jul 27, 2017 · 5 comments

Comments

@helgatheviking
Copy link
Contributor

The pixel doesn't seem to fire after an item has been added to the cart asynchronously from the archive pages.

@dmitridr
Copy link
Contributor

We definitely don't fire the pixel on AJAX add to cart. We could support this in the future based on demand for this feature, it would be a big change for us though.

@helgatheviking
Copy link
Contributor Author

I ended up writing it into my own plugin. I don't have time for a PR right now, but I could probably paste some snippets of you wanted.

@dmitridr
Copy link
Contributor

Definitely interested in how you solved this! Would love to see some snippets.

@helgatheviking
Copy link
Contributor Author

Pulling very heavily from your plugin, I added some code into the "base pixel" that fires a second little ajax request when the ajax add to cart JS trigger fires
https://github.com/AltoLabs/snappic-woocommerce/blob/master/includes/class-snappic-pixel.php#L34-L47

That builds the new pixel event and sends it back to the script to be injected in the <head>
https://github.com/AltoLabs/snappic-woocommerce/blob/master/includes/class-snappic-pixel-display.php#L98-L109

Hope that helps!

@dmitridr
Copy link
Contributor

dmitridr commented Oct 9, 2017

Thanks for that! I would definitely like to set aside some time to merge this into our repo but we're dealing with a large number of bugs right now. If you ever have time to send that PR we could review it pretty quickly though! Please consider it.

@auludag auludag mentioned this issue Nov 19, 2018
deivamagalhaes pushed a commit that referenced this issue May 21, 2020
Fix critical issues in facebook-for-woocommerce.php
deivamagalhaes pushed a commit that referenced this issue May 21, 2020
…-fixes

Improve tracking consistency of AddToCart and ViewContent events
@Klausdks Klausdks mentioned this issue Aug 3, 2022
2 tasks
budzanowski pushed a commit that referenced this issue Oct 17, 2023
brezocordero added a commit that referenced this issue Jul 26, 2024
The parameter at position #2 of get_terms() has been deprecated since WordPress version 4.5.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants