Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Every GA Ecommerce transaction allows me to send just two variables, name and category, to describe each product. I want to send additional data to create more useful reports. For example, I have t-shirts, jeans, shoes... and I want to send the brand and size too.

_gaq.push(['_addItem',
  'N. 87987',         // transaction ID
  'TSATR5',         // SKU
  't-shirt',      // product name
  'men',          // category
  'Adidas',        // A custom category
  '25.99',        // price
  '1'             // quantity
]);

I know that the example above doesn't work because the _addItem() method does not accept extra parameters. I tought that custom variables could help me to solve this riddle but actually they couldn't.

Is there a way to send this extra data to Google Analytics?

share|improve this question
add comment

migrated from stackoverflow.com Feb 5 at 20:29

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

The fields that you have are the fields that you have. If you want to get more data into them, your best bet is to overload some of the optional, or required fields. I personally overload the "SKU" field with whatever data I want. It comes up nicely in the default reporting that way. https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce?hl=en

Another strategy would be to track events that represent the data that you like. Events can literally track any subjective thing that you want to know, if you fire them off at the correct time. You'll have to dig a little differently for your reports, but you'll get the data that you need. https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide?hl=en

Custom vars as you have mentioned like to attach themselves to every single call, so that gets murky pretty quickly if what they track are not related to the user or session.

share|improve this answer
    
I overload the product name, indeed, that's a greeat idea. Then I create custom reports filtering what I send in the overloaded _addItem() method. I thought there might be a more elegant solution for this. The idea with the events sounds good! I'll check it out. Thank you so much, @Mike_K. –  albertoms Feb 12 at 19:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.