• So, the customer data is empty for WooCommere Guest accounts, is there a way to get the data for guest? I will need this informations for Google Ads-Enhanced Conversion-Tracking.

    customerBillingFirstName: "",
      customerBillingLastName: "",
      customerBillingCompany: "",
      customerBillingAddress1: "",
      customerBillingAddress2: "",
      customerBillingCity: "",
      customerBillingPostcode: "",
      customerBillingCountry: "",
      customerBillingEmail: "",
Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m experiencing the same issue.
    See the screenshot here: https://pasteboard.co/raSUzGlDRvY2.jpg
    any solution?

    This is my current setup:

    WordPress
    Version 6.0.1

    WooCommerce
    Version 6.8

    Google Tag Manager for WordPress
    Version 1.16.1

    Greetings,

    Matteo

    Thread Starter blubbering

    (@blubbering)

    I think it’s like that for non logged in users.
    I added the information to the ?Thank you page? with the functions.php

    add_action( 'woocommerce_thankyou', 'adding_customers_details_to_thankyou', 10, 1 );
    function adding_customers_details_to_thankyou( $order_id ) {
        // Only for non logged in users
        if ( ! $order_id ) return;
    
        $order = wc_get_order($order_id); // Get an instance of the WC_Order object
    
        wc_get_template( 'order/order-details-customer.php', array('order' => $order ));
    }

    Hello,
    I also had the same issue and found a solution.

    To log data for all users making an order you have to go to GTM4WP settings -> Integration – > WooCommerce and choose “order data in data layer”.

    And then you can define the variables in Tag Manager:

    Currency – > orderData.totals.currency
    Value – > orderData.totals.total (or orderData.totals.subtotal if you need without tax/shipping)
    ID – > orderData.attributes.order_number
    Firstname – > orderData.customer.billing.first_name
    and so on for the other fields you need.

    The firing event for the tag is gtm4wp.orderCompletedEEC

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customer data in data layer -> Guest’ is closed to new replies.