• Resolved vladimirvuch

    (@vladimirvuch)


    Hello, I have a problem with the purchase event.
    When going to the checkout page. Even if it doesn’t actually complete due to a missing parameter in the fields. The event is sent and reported by the Pixel. I’ve noticed this problem on other sites as well. How can I fix this event to only be sent when a purchase successfully completes without errors in the customer details.
    And not to be sent on every click. Because at the moment you can click 5 times and finally exit the page and not actually have an order, and the event will be sent 5 times and reported.

    The site is beststore.bg

    You can check its work there by putting a test on the name for example.
    And if you have a problem field, you’ll notice through Meta Pixel Helper that the “purchase” event is sent even though you stay on the page and don’t complete the order.

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi there @vladimirvuch ??

    Thanks for reaching out about this. Let’s troubleshoot it together!

    How can I fix this event to only be sent when a purchase successfully completes without errors in the customer details.
    And not to be sent on every click. Because at the moment you can click 5 times and finally exit the page and not actually have an order, and the event will be sent 5 times and reported.

    From what I gather, the purchase event is registered multiple times on Facebook’s end, despite a purchase not being made on the site, actually. Correct?

    I went ahead with visiting the Checkout page, at beststore.bg, and the Meta Pixel Helper is reporting the following, on my end.

    Direct link to image: https://snipboard.io/FJNd8U.jpg

    Just to be sure, did you already have a chance to test with temporarily disabling any caching plugins/mechanisms on the site, and see if the issue persists, or otherwise?

    Furthermore, to get an idea of how your site is configured, could you please share a copy of your site’s System Status, as exemplified here? Once you’ve done that, paste it here in your response.

    Looking forward to hearing from you!

    Thread Starter vladimirvuch

    (@vladimirvuch)

    Please clear your browser cache.
    The exclamation point issue has been fixed. And it is no longer noticeable. I removed a PWA plugin that was causing a cache issue in background mode. Without knowing about him.
    https://ibb.co/jLXCwfN
    https://ibb.co/t86Vjgd
    https://ibb.co/D90m3Zx
    https://ibb.co/d6kgctw

    This is picture for test i finished 1 order succese other is not real order

    https://gist.github.com/ludjoker/6d792c7f6baafbf8315f7a81497568c9

    Hello vladimirvuch,

    Thank you for your reply.

    I understand that you’re experiencing unexpected behavior with the Facebook Pixel on your site, where the 'purchase' event seems to be triggered before an actual transaction completes during the checkout process.

    I went to your website at?beststore.bg?and followed through the checkout process to observe the Pixel’s behavior. On the checkout page, I noticed that the "InitiateCheckout" event has been triggered, as expected.

    Here is a screenshot for your reference:
    https://prnt.sc/jqsVTwuDbGsP

    After reviewing Facebook’s documentation, it’s clear that the “InitiateCheckout” event is supposed to trigger at this point during the customer’s interaction. However, it’s the “Purchase” event that is specifically intended to fire only once the customer completes the order.

    Could you please tell me what steps you are taking that triggers the Purchase event? I noticed an WooCommerce error notice on your end but it is in Bulgarian so I cannot understand it.

    I am looking forward to your response. ??

    Thread Starter vladimirvuch

    (@vladimirvuch)

    I’m not sure I understand the question.
    “Could you please tell me what steps you are taking that triggers the?Purchase?event??“

    I am not taking any steps. The page is on Woocommerce. What I have changed is how it looks.
    And the message, which is in Bulgarian, says that there are fields not filled out. Like name or phone or whatever else is mandatory and not filled. Or they haven’t marked agreement with the terms. Which are the standard things that there are in the Woocommerce checkout page.

    You can translate the messages with Google translator if necessary but no matter what the error is, it always sends the “purches” event when the purchase button is pressed. And you said, as I expect, that it sends it only if the order is successful and not every time it is clicked. As can be seen from the photos.

    I have currently added my event to receive when a real purchase is made and the customer is redirected to another page. But this is not correct behavior.

    This “InitiateCheckout” I think is submitted correctly and should be sent when the user comes to the checkout page. This will track the difference between users who started to order, canceled while ordering, and actually ordered.

    I can also implement another site with another Pixel plugin where the behavior is valid. And when the order is not actually completed, the Purchased event is not sent. A is sent only upon successful completion.

    Hi there @vladimirvuch ??

    To further isolate the issue, I’d recommend performing a conflict test, as detailed here.

    Another plugin has already been identified causing a caching issue, and the only report I can find on GitHub, is from almost a year ago and marked as closed (linked here).

    Let us know how it goes, please. Should the issue persist, to get an idea of how your site is configured, could you please share a copy of your site’s System Status, as exemplified here? Once you’ve done that, paste it here in your response.

    Looking forward to hearing from you!

    Thread Starter vladimirvuch

    (@vladimirvuch)

    Hello.

    After many tests and stopping different plugins the result is the same.
    Continues to dispatch the Purchased event each time the button is pressed.
    The behavior is the same on other sites where I have used the plugin.
    Please guide me how to proceed. I don’t see any errors in the logs, as you can check yourself in the old log I sent you. I can also send a new one, but there are no errors.

    Please send me a site where the behavior is as I expect and uses this plugin so I can try to track the behavior there.

    Hi there @vladimirvuch ??

    After many tests and stopping different plugins the result is the same.
    Continues to dispatch the Purchased event each time the button is pressed.
    The behavior is the same on other sites where I have used the plugin.
    Please guide me how to proceed. I don’t see any errors in the logs

    Just to clarify, did you already have a chance to test with the following set up, and see if the issue persists, or otherwise?

    • A default theme, like TT3, active
    • Only the WooCommerce plugin activated
    • One of the core payment options for WooCommerce selected at checkout

    We await your response to better assist you.

    Thread Starter vladimirvuch

    (@vladimirvuch)

    It’s absurd to test this way on a site that works. Is there an option to add an option to explicitly send this event when a transaction is activated or a purchase is successfully completed.
    As in other similar plugins.

    Or rather consider transferring to one of them. Because there is no way to do all these tests again on a working site.

    Hey, @vladimirvuch!

    I understand doing a conflict test on a working site is very complicated.

    I have two suggestions if you are not able to do it on the workign site:

    — You can consider using a plugin like Health Check & Troubleshooting. This is a plugin developed by the WordPress community and it is helpful to disable plugins without affecting your current site visitors.

    — You can also consider a staging functionality (you can ask your host if they offer this service), or you can use WP Staging for quickly spinning up a new test site.

    Please let us know about your findings.

    Looking forward to your reply.

    Have a wonderful day!

    Thread Starter vladimirvuch

    (@vladimirvuch)

    Ok thanks for the plugins I will review them and in the next few days I will do tests with them. I hope they work and I can do tests.

    Hi @vladimirvuch,

    That sounds like a plan. Please take your time trying it out, and feel free to get back to us if you encounter any issues.

    Thanks again for your patience and cooperation.

    Thread Starter vladimirvuch

    (@vladimirvuch)

    From all tests and stopping all plugins and then deleting them. I found that the case is when using the woocommerce shortcode for the checkout page [woocommerce_checkout] when I manually create the checkout page so I can change the design. Then comes the problem.
    Have you come across anything like this I use Elementor pro as an additional page builder plugin.
    But even when I stop it if I use the shortcode the problem appears. If the page is generated by woocommerce, there is no problem and the event is sent correctly.
    Any idea how I can fix this?
    And what can I do?

    I can’t find any information about this and I don’t see any reason for it to be a problem. The shortcode should make a copy of the original checkout page that can simply be injected with a shortcode.

    Thread Starter vladimirvuch

    (@vladimirvuch)

    The problem comes from calling these requests, which are to refresh the page, but actually call and call the event.
    https://ibb.co/CPCh5Hg

    I am currently trying to find out where they are.
    Can you guide me how the plugin works and what is called to fire the purchased event?

    Thread Starter vladimirvuch

    (@vladimirvuch)

    I have reviewed your facebook-commerce-events-tracker.php file
    As I see that the purchased event is processed in it.
    Can any snippet that update event only on real transaction and no error returned by methods public function get_posted_data() { i process_checkout()
    . If they return a valid value and not an error, only then send the purchased event. Because at the moment the Ajax methods that are called are to verify the fields, but they return an error and stop the order.
    But on your side the event is sent as if the order is valid and not processing the result of those functions that returned an error.

    These functions are located in the file class-wc-checkout.php which is the default in the woocommerce plugin

    Hi @vladimirvuch,

    Thank you for sharing a detailed explanation of the issue and your debug results.

    When setting up your checkout page, either through Elementor or manually, did you check if there were any AJAX verification calls returning errors in the browser console?

    It’s just a thought, but a potential solution might be to add a custom code that triggers the purchased event. This would only happen if the get_posted_data() and process_checkout() methods give us a successful response.

    Have you reached out to Elementor Pro support about this issue? If so, were they able to provide any insights?

    Looking forward to hearing from you!

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘problem with the purchase event’ is closed to new replies.