AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
4.7K members online now
4.7K members online now
Learn how to set up goals and Ecommerce tracking, verify accuracy of attribution traffic sources, and discuss funnel visualization, Multi-Channel Funnels, the Goal Flow Report, and Enhanced Ecommerce
 
Guide Me
star_border
Reply

Sending Custom Usertype in ecommerce transaction

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

Can I able to send my application user type to Google Analytics in ecommerce transasction as below:' I want to send in the above code user type for each transaction type

 

ga('ecommerce:addTransaction', {
  'id': '1234',                     // Transaction ID. Required.
  'affiliation': 'Acme Clothing',   // Affiliation or store name.
  'revenue': '11.99',               // Grand Total.
  'shipping': '5',                  // Shipping.
  'tax': '1.29'                     // Tax.
});

 


I'd like the website to pass the 'Web Customer Type' field with all transactional data.

Thanks,
Sriram

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author SilverPlate
April 2016

Re: Sending Custom Usertype in ecommerce transaction

Top Contributor
# 8
Top Contributor
Hi Sriram,

Just checked your code again.

You need to define your custom dimension in your code as "dimension1" (1 is the dimension index in GA) instead of the dimension name.

So instead of "cust_type: "Consumer""
It should be "dimension1: "Consumer""

Let me know if you can get it work.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Re: Sending Custom Usertype in ecommerce transaction

Top Contributor
# 2
Top Contributor

Hi,

 

You can set up a custom dimension for the field you want to send:

 

https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets#overview
https://support.google.com/analytics/answer/2709828

 

Then send the value together with your transaction data to GA:

 

ga('ecommerce:addTransaction', {
  'id': '1234',                     // Transaction ID. Required.
  'affiliation': 'Acme Clothing',   // Affiliation or store name.
  'revenue': '11.99',               // Grand Total.
  'shipping': '5',                  // Shipping.
  'tax': '1.29'                     // Tax.
  'dimension1': 'user-type'       // User Type
});

Hope this helps, let me know if you have questions.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Sending Custom Usertype in ecommerce transaction

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi,
Thanks for you code. I have done the changes in the code and sent to GA but I am not able to view the data at GA - Behaviour - New vs Returning - Primary Dimension - UserType , Secondary Dimension - Transaction ID.

I got the view the of the transaction no#. but no information. with secondary Dimension. May I know how to view the data.

Regards,
Sriram

Re: Sending Custom Usertype in ecommerce transaction

Visitor ✭ ✭ ✭
# 4
Visitor ✭ ✭ ✭
Hi,

Below is the reply from debugging through console.

Running command: ga("ecommerce:addTransaction", {id: "167724", affiliation: "XYZ.", revenue: "49.99", shipping: "8.99", tax: "2.56", cust_type: "Consumer"})

Running command: ga("ecommerce:send")

analytics_debug.js:9 Set called on unknown field: "cust_type".


Do I need to any other way to send custom dimensions ??

Regards,
Sriram

Re: Sending Custom Usertype in ecommerce transaction

Top Contributor
# 5
Top Contributor
Hi,

Did you set up the custom dimension "cust_type" in Admin -> Property -> Custom Definitions -> Custom Dimensions?

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Sending Custom Usertype in ecommerce transaction

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Yes. I have done the settings.

Re: Sending Custom Usertype in ecommerce transaction

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
HI,

Do I need to setup any settings in Google Tag Manager or GA to make the custom dimension variable/field to identify.

Regards,
Sriram
Marked as Best Answer.
Solution
Accepted by topic author SilverPlate
April 2016

Re: Sending Custom Usertype in ecommerce transaction

Top Contributor
# 8
Top Contributor
Hi Sriram,

Just checked your code again.

You need to define your custom dimension in your code as "dimension1" (1 is the dimension index in GA) instead of the dimension name.

So instead of "cust_type: "Consumer""
It should be "dimension1: "Consumer""

Let me know if you can get it work.

Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital