• Resolved gfour

    (@gfour)


    Hello Thomas (and all),
    I’m asking for your support as, in some steps of user journey in our website, GTM does not get the datalayer’s content as it should has been.
    From TAG Assistant
    1. view_item
    One item object is expected within items but three item objects are populated instead.
    API call

    dataLayer.push({
      event: "view_item",
      ecommerce: {
        currency: "EUR",
        value: 30,
        items: [ {
            item_id: "LIS-PINK",
            item_name: "Pink Lisianthus",
            item_brand: "",
            price: 30,
            item_category: "Flowers",
            google_business_vertical: "retail",
            id: "LIS-PINK"
        } ]
      },
      gtm.uniqueEventId: 26
    })

    Datalayer

    {
      event: "view_item",
      gtm: {uniqueEventId: 26, start: 1645788119312},
      visitorDoNotTrack: 0,
      visitorLoginState: "logged-out",
      productRatingCounts: [],
      productAverageRating: 0,
      productReviewCount: 0,
      productType: "simple",
      productIsVariable: 0,
      ecommerce: {
        currencyCode: "EUR",
        detail: {
          products: [
            {
              id: "LIS-PINK",
              name: "Pink Lisianthus",
              sku: "LIS-PINK",
              category: "Flowers",
              price: 30,
              stocklevel: null,
              brand: ""
            }
          ]
        },
        impressions: [
          {
            name: "Rose Bouquet Kahala",
            id: "ROSE-K",
            price: "36.00",
            category: "Flowers",
            position: "1",
            list: "Related Products",
            stocklevel: "",
            brand: ""
          },
          {
            name: "Ranunculus",
            id: "RANUNCULUS",
            price: "15.00",
            category: "This week's special",
            position: "2",
            list: "Related Products",
            stocklevel: "",
            brand: ""
          },
          {
            name: "Tulips Yellow",
            id: "TULIP-YEL",
            price: "18.00",
            category: "Flowers",
            position: "3",
            list: "Related Products",
            stocklevel: "",
            brand: ""
          }
        ],
        currency: "EUR",
        items: [
          {
            item_id: "LIS-PINK",
            item_name: "Pink Lisianthus",
            item_brand: "",
            price: 30,
            item_category: "Flowers",
            item_list_name: "Related Products",
            index: "1",
            google_business_vertical: "retail",
            id: "LIS-PINK"
          },
          {
            item_id: "RANUNCULUS",
            item_name: "Ranunculus",
            item_brand: "",
            price: "15.00",
            item_category: "This week's special",
            item_list_name: "Related Products",
            index: "2",
            google_business_vertical: "retail",
            id: "RANUNCULUS"
          },
          {
            item_id: "TULIP-YEL",
            item_name: "Tulips Yellow",
            item_brand: "",
            price: "18.00",
            item_category: "Flowers",
            item_list_name: "Related Products",
            index: "3",
            google_business_vertical: "retail",
            id: "TULIP-YEL"
          }
        ],
        value: 30
      }
    }

    The same happens with select_item and addToCart . Seems like dataLayer[‘ecommerce’] could not be initialized and so is polluted with previous data pushes.

    I would appreciate any help provided
    Thank you in advance

    • This topic was modified 2 years, 9 months ago by gfour.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter gfour

    (@gfour)

    For testing purposes you can visit the link below. Many pictures are missing so the front-end seems to be broken but do not be afraid ??
    https://baggagement.ae

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    What you see is the actual, merged (!) content of the data layer.
    If you look at the GA4 hits, you will see that there are actually two events sent:

    1) view_item_list: contains products in the related products section
    2) view_item: contains the single product that the detail page is about

    Thread Starter gfour

    (@gfour)

    Thank you Thomas for the prompt reply.

    So, what we see in Tag Details-Properies-Event Parameters when we select the firing tag(s) for an event at the left side bar are the data that actually passed to analytics for this specific event.

    Thank you again for bringing the light before my eyes ??

    • This reply was modified 2 years, 9 months ago by gfour.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Datalayer.ecommerce.items object is polluted with previous data’ is closed to new replies.