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

    (@duracelltomi)

    Hi,

    This is a bit tricky currently as needs a custom JavaScript variable in GTM with the following content:

    function() {
        return {
            "email": {{yourEmailVariable}}, 
            "phone_number": {{yourPhoneVariable}},
            "address": {
                "first_name": {{yourFirstNameVariable}}
                "last_name": {{yourLastNameVariable}},
                "street": {{yourStreetAddressVariable}},
                "city": {{yourCityVariable}},
                "postal_code": {{yourPostalCodeVariable}},
                "country": {{yourCountryVariable}}
            }
        }
    }

    Each {{yourXXX}} is another GTM variable with the type Data Layer Variable. You can read all from the data layer using these variable names:

    {{yourEmailVariable}} – customerBillingEmailHash
    {{yourPhoneVariable}} – customerBillingPhone
    {{yourFirstNameVariable}} – customerBillingFirstName
    {{yourLastNameVariable}} – customerBillingLastName
    {{yourStreetAddressVariable}} – customerBillingAddress1
    {{yourCityVariable}} – customerBillingCity
    {{yourPostalCodeVariable}} – customerBillingPostcode
    {{yourCountryVariable}} – customerBillingCountry

    Thread Starter rymo123

    (@rymo123)

    Hey Thomas,
    thank you for you answer.

    If you do not wish to use the coding option, you can use the Data Layer Variable option in GTM and use Data Layer Variable Name orderData.customer.billing.phone for the phone etc.

    However, Google needs the phone number in +441234567890 format, while the plugin provides the phone number as entered by the customer.

    Thomas, does the plugin provide any filter to edit the phone output please?

    Plugin Author Thomas Geiger

    (@duracelltomi)

    You can use the gtm4wp_compile_datalayer hook with a lower priority setting to catch the datalayer in the header before it gets rendered.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Google Ads & Enhanced Conversions’ is closed to new replies.