• the problem concerns the “Thank you” page after checkout.

    DataLayer is being pushed (see “Shop1” in Screenshot attached).
    –> But the transaction ID is not formatted as a string (as “required”? per Google Standard definition – to the left in the screenshot)

    I have another shop where your plugin is in use. (Shop 2 in screenshot).
    –> Transactions are tracked just fine here.
    –> “ID” is in the form of “string” (not number)

    My questions:
    1. Why is transaction ID not “string” in Shop 1
    2. Might that be the reason no transaction is being tracked?

    PS: As I said: Both Shops are using the same (identical) GTM and Tracking-Setup.
    What I described above is the only difference.
    So I am hoping that:
    a) this might be the solution to my problem
    b) there is a way to re-format the transaction ID to a string in the dataLayer by simply having to change a setting in WP or WC or gtm4wp

    screenshot here: https://snipboard.io/I3cHS8.jpg

    Thanks for your time and help.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Technically the “id” attribute is populated directly with the result of the get_order_number() function call.

    Per documentation this returns a string.
    It is added as an array value and then outputted using the json_encode() function.

    For some reason, either of these functions convert the type of the “id” parameter to integer.

    Do you have a dev site where you can test what gets outputted if we change a bit in the code?

    In the plugin folder, under “integrations” you will see a woocommerce.php file.
    In that, you need to each instance of the get_order_number() call.

    In each case you will see this method call:

    $order->get_order_number()

    This should be extended with this:

    (string)$order->get_order_number()

Viewing 1 replies (of 1 total)
  • The topic ‘Wrong DataLayer Var Type = not tracking orders?’ is closed to new replies.