How to add the phone_number parameter in the Purchase event on WooCommerce?

24 Views Asked by At

According to the upcoming Google Ads update, it's needed to add the new phone_number parameter in the purchase event.

Is there any way to implement this parameter without much coding?

This is where it should appear:

{
  event: "purchase",
  gtm: {uniqueEventId: 21, start: 1706607079162},
  visitorLoginState: "logged-in",
-->  phone_number:"370123123123"
  visitorEmail: "[email protected]",
  visitorEmailHash: "164654354351"
  visitorId: 1000,
  pagePostType: "page",
  pagePostType2: "single-page",
  pagePostAuthor: "XXX",
  new_customer: false,
  ecommerce: {
    currency: "EUR",
    transaction_id: "100000",
    affiliation: "",
    value: 23.6,
    tax: 4.1,
    shipping: 1.4,
    coupon: "",
    items: [
      {
        item_id: "100",
        item_name: "Product name",
        item_brand: "",
        price: 21.9,
        item_category: "Product category",
        quantity: 1,
        google_business_vertical: "retail",
        id: "10000"
      }
    ]
  },
  developer_id: {dNDI5Yz: true},
  eventModel: {
    transaction_id: "10000",
    affiliation: "domain.com",
    currency: "EUR",
    value: 23.6,
    discount: 0,
    tax: 4.1,
    shipping: 1.4,
    coupon: "",
    items: [
      {
        quantity: 1,
        price: 21.9,
        item_name: "Product name",
        currency: "EUR",
        item_category: "Category"
        item_id: "10000",
        item_brand: ""
      }
    ]
  }
}

I tried to look through WooCommerce's documentation WooCommerce, but couldn't find a solution.

0

There are 0 best solutions below