0

I'm pushing some tags to the data layer and they all seem to be working as expected except for ecommerce transaction data. I have confirmed that the transaction data is being pushed to the data layer but for some reason I'm not seeing any results in Google Analytics—even after waiting 48 hours.

I should mention that this is an SPA so there is no page refreshing. The data is pushed to the data layer after the payment is successfully processed.

This is the data I'm sending:

{
  event: 'subscribe',
  user: <USER_ID>,
  subscribe: {
    transactionId: <CUSTOMER>,
    transactionAffiliation: <AFFILIATION>,
    transactionTotal: <PRICE>,
    transactionProducts: [
      {
        id: <CUSTOMER>,
        sku: <SUBSCRIPTION>,
        name: <PLAN>,
        price: <PRICEPER>,
        quantity: <QUANTITY>
      }
    ]
  }
};

Is there something wrong with the way I'm formatting this? Any ideas why this doesn't seem to be working?

jwerre
  • 9,179
  • 9
  • 60
  • 69
  • Is there a particular reason you are using the custom event "subscribe" instead of the standard `"event":"checkout"` key? – Iskandar Reza Nov 02 '18 at 19:16
  • Because the former is like voodoo magic to configure and the latter just kinda works. – Iskandar Reza Nov 02 '18 at 19:17
  • So you think I should just use 'checkout'? That was one concern I had. – jwerre Nov 02 '18 at 19:42
  • I noticed 'checkout' as an event name for enhanced ecommerce setup but wasn't sure how standard ecommerce was supposed to work. Should I use 'checkout' as the event name or as the key name for my transaction data or both? – jwerre Nov 02 '18 at 19:50
  • When are you pushing that data to the DL? I'm assuming when someone clicks on a "subscribe" button? – XTOTHEL Nov 02 '18 at 20:03
  • @XTOTHEL When the user clicks the subscribe button, I process the form and submit the payment. When the payment request returns successfully (200) then I push the transaction to the Data Layer. – jwerre Nov 02 '18 at 20:13

1 Answers1

0

For just regular NOT enchanced ecomm, you need to make some adjustments to your datalayer first:

{
  event: 'subscribe',
  user: <USER_ID>,
  transactionId: <CUSTOMER>,
  transactionAffiliation: <AFFILIATION>,
  transactionTotal: <PRICE>,
  transactionProducts: [{
        id: <CUSTOMER>,
        sku: <SUBSCRIPTION>,
        name: <PLAN>,
        price: <PRICEPER>,
        quantity: <QUANTITY>
  }]
};

Then create a custom event trigger referencing the subscribe event: enter image description here

Then create a GA tag and select Track Type of Transaction, elect your GA settings variable and set the trigger to that custom event trigger we created above: enter image description here

XTOTHEL
  • 5,098
  • 1
  • 9
  • 17