Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA4 - OrderPlaced Event / Purchase Event - Missing affiliation #142

Open
claudiubee opened this issue May 19, 2023 · 0 comments
Open

GA4 - OrderPlaced Event / Purchase Event - Missing affiliation #142

claudiubee opened this issue May 19, 2023 · 0 comments

Comments

@claudiubee
Copy link

Describe the bug
transactionAffiliation / affiliation should be set per item.
Current event payload for purchase (with Send Google Analytics 4 Events active):

dataLayer.push({
  event: "purchase",
  ecommerce: {
    transaction_id: "1333180500286",
    value: 5085.66,
    tax: 0,
    shipping: 5,
    coupon: null,
    items: [
      {
        item_id: "55",
        item_name: "G-Series G55-1850 Supercore Standard Rotation 85MM Comp Ind",
        item_brand: "Demo",
        item_variant: "76",
        price: 5080.66,
        quantity: 1,
        item_category: "Supercores",
        dimension1: "",
        dimension2: "880547-5001S",
        dimension3: "G-Series G55-1850 Supercore Standard Rotation 85MM Comp Ind",
        dimension4: "available"
      }
    ],
    currency: "USD"
  },
  gtm.uniqueEventId: 309
})

Expected payload:

dataLayer.push({
  event: "purchase",
  ecommerce: {
    ...
    items: [
      {
            affiliation: "Seller Demo",
      }
    ],
    currency: "USD"
  },
  gtm.uniqueEventId: 309
})

OrderPlaced event contains the affiliation but not at item level.
Current payload:

dataLayer.push({
  event: "orderPlaced",
  currency: "USD",
  eventName: "vtex:orderPlaced",
  ...
  ecommerceV2: {
    ecommerce: {
      purchase: {
        actionField: {
          affiliation: "Demo Seller",
          coupon: null,
          id: "1333180500286",
          revenue: 5085.66,
          shipping: 5,
          tax: 0
        },
        products: [
          {
            brand: "Demo",
            category: "Turbochargers/Supercores",
            id: "55",
            variant: "76",
            name: "G-Series G55-1850 Supercore Standard Rotation 85MM Comp Ind",
            price: 5080.66,
            quantity: 1,
            dimension1: "",
            dimension2: "880547-5001S",
            dimension3: "G-Series G55-1850 Supercore Standard Rotation 85MM Comp Ind"
          }
        ]
      }
    }
  },
  gtm.uniqueEventId: 364
})

Expected payload:

dataLayer.push({
  event: "orderPlaced",
  currency: "USD",
  eventName: "vtex:orderPlaced",
  ...
  ecommerceV2: {
    ecommerce: {
      purchase: {
        actionField: {
          affiliation: "Demo Seller",
          coupon: null,
          id: "1333180500286",
          revenue: 5085.66,
          shipping: 5,
          tax: 0
        },
        products: [
          {
            ...
            affiliation: "Demo Seller",
            ...
          }
        ]
      }
    }
  },
  gtm.uniqueEventId: 364
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant