• Resolved ridings3d

    (@ridings3d)


    I had noticed that a few of the websites I manage was having issues double reporting and it seemed to be from people that were revisiting their thank you page across multiple days. I have nailed the issue down to the file “GlobalSiteTag.php” located in the src > Google folder. The issue resides on line 358 and has to do with the strict checking of the returned meta key value. The function “get_meta” will return a string and not an integer in this case because the database for meta values is set as text. To fix this issue, Line 358 – 360 in the file “GlobalSiteTag.php” should change from:

        if ( ! $order || 1 === $order->get_meta( self::ORDER_CONVERSION_META_KEY, true ) ) {
            return;
        }

    To:

        if ( ! $order || '1' === $order->get_meta( self::ORDER_CONVERSION_META_KEY, true ) ) {
            return;
        }

    To stay consistent, the line 363 should also be changed to a string instead of a integer.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Zee

    (@doublezed2)

    Hello ridings3d,

    Thank you for contacting WooCommerce support.

    I appreciate your effort and time investigating the issue and sharing the solution here.
    To confirm, are you using the latest version of Google for WooCommere 2.9.2?

    Also, have you reported this issue earlier on this forum or GitHub?
    I would like to learn more about this issue.

    Looking forward to your response. 🙂

    Thread Starter ridings3d

    (@ridings3d)

    Hello there!

    Yes, we are running 2.9.2 and no I have not reported this issue on GitHub. I was unaware at the time of the GitHub repo.

    Thanks!

    Hello @ridings3d,

    Thank you for sharing these details and your findings regarding the strict comparison issue in the GlobalSiteTag.php file. It does appear to be a potential bug, as WooCommerce meta values are stored as text, which can cause strict comparison (1 === ‘1’) to fail.

    To help move this forward, could you please submit a bug report on our GitHub repository here:

    https://github.com/woocommerce/google-listings-and-ads/issues

    Before submitting the report, I recommend testing this further to confirm the behavior. This will ensure the development team has all the necessary information to address the issue effectively.

    Thank you. Let us know if you have anymore questions.

    Thread Starter ridings3d

    (@ridings3d)

    Will do! Thank you!

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    If you have a few minutes, we’d love if you could leave us a review: https://ww.wp.xz.cn/support/plugin/google-listings-and-ads/reviews/

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Double Reporting’ is closed to new replies.