Track purchase data with Google Analytics e-commerce without hard coding product information

Our company markets many products online and we need to track the purchase of each one through Google Analytics. In the e-commerce tracking examples I find the product info is hard coded in the tracking script.  Due to the nature of my product and the design of third-party sites hosting the e-commerce, I cannot hard code all the product info. I prefer to get the data as part of an array and pass those values back to Google Analytics.

Assuming the data fields have intuitive names (product, price, quantity, total), can you help me code the tracking script for that? Below is the example of what I do not want to do:

_gaq.push(['_addTrans',
      '1234',       // order ID
      'StoreName',  // store
      '19.99',      // total
      '1.50',       // tax
      '3.00',       // shipping
      'Tulsa',    // city
      'Oklahoma',   // state
      'USA'         // country
]);
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT DirectorAsked:
Who is Participating?
 
Scott Fell, EE MVEConnect With a Mentor Developer & EE ModeratorCommented:
I just started using this and not fully up to speed but I think you want tag manager http://google.com/tagmanager
0
 
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT DirectorAuthor Commented:
Thanks Padas. I'm going to research that and will get back in a few days. I will be back online next Monday and hopefully this will work. (I didn't want you to think I was dormant).
0
 
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT DirectorAuthor Commented:
Padas, it's been a while since I gave feedback. I am still trying to make this solution work. I do believe it will be the best possible one out there so I would like to award you full points. Thank you.
0
Get Certified for a Job in Cybersecurity

Want an exciting career in an emerging field? Earn your MS in Cybersecurity and get certified in ethical hacking or computer forensic investigation. WGU’s MSCSIA degree program was designed to meet the most recent U.S. Department of Homeland Security (DHS) and NSA guidelines.  

 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Thank you!  
Some how the points did not come through.  Just request attention if you need to change this.
0
 
Randy ColeDigital Marketing, Marketing Director, Market Manager, IT DirectorAuthor Commented:
I choose GOOD not because of Padas, but because I have not bullet-proof tested the solution. However, Padas gave a great suggestion.
0
 
JuliamacCommented:
I'm looking for the same solution - and don't want to invest time if it didn't work - does anyone have any update or useful feedback here please?

many thanks
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I have not had a chance to fully dive into this yet.  But have started reading.  Universal analytics has a lot of possibilities.  

http://analytics.blogspot.com/2014/04/universal-analytics-out-of-beta-into.html 

Also note, that their samples show static data, but it is up to you to auto generate the code just as you auto generate your code for products https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce
0
 
JuliamacCommented:
Hey thanks padas, I'm going to try this out. I have a paypal integration question re whether or not you should still append tracking  utm_nooverride=1to your 'thankyou' page if you're using e-commerce tracking. if you can answer this I'll repost it and give you the points!

thanks again
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I don't have a good answer for that now.  Like I said, I have not had a chance to dive into this too deeply.  

I can't find it now, but I either saw a video or read an article about tracking peoples movement through a physical store using universal analytics.  Lots of possibilities https://www.youtube.com/watch?v=nCeJITfEhSk   

Thanks for the point offer, but no need.
0
 
JuliamacCommented:
Ok that's great - thanks!
0
 
JuliamacCommented:
Thanks but I have resolved this.
0
 
JuliamacCommented:
Misread your comment in haste - apologies!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.