Analytics
2K members online now
2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

How do I add Custom Dimensions to GA Event

[ Edited ]
Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hi 

 

I need help or rather confirmation if I'm going the right direction.

 

GTM Setup:

dataLayer with variable pageCategory. Page Category dimension set from pageCategory variable (This is working as expected for pageviews).

 

GA Setup:

Custom Dimension Page Category index: 1 , Scope: hit

 

I need to use this same Page Category dimension for events.

 

I've read the documentation and there is only one point that is confusing me. According to the documentation one of the parameters is a [fieldsObject].

 

ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);

 

 

My plan:

 

ga('send', 'event', 'category', 'action', 'label' {
  'dimension1': dataLayer[0].pageCategory
});

As you can see I don't have an eventValue argument and no-where in the documentation does it mention what I'm supposed to do with the eventValue parameter since it comes before [fieldsObject]. Normaly if you want to skip a parameter you'd put undefined or null.

 

The answer could be as simple as putting 1 under event value. But I need to be absolutely sure.

 

 

 

 

 

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Kudakwashe Z
November 2015

Re: How do I add Custom Dimensions to GA Event

Top Contributor
# 4
Top Contributor

You have 2 ways of sending your event with a value and custom dimensions

 

 

ga('send', {
  hitType: 'event',
  eventCategory: 'My Category',
  eventAction: 'My Action',
  eventLabel: 'My Label',
  eventLabel: 'My Value',
  dimension1: 'the value for my dimension'
});

or alternatively, and more elegant:

 

 

ga('send', 'event', 'My Category', 'My Action', 'My Label', 'My Value', {
'dimension1': 'the value for my dimension'
});

Or not use the custom dimension at all, since your're passing event value in either of the two snippets above.

Hope that helped.

 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

View solution in original post

Re: How do I add Custom Dimensions to GA Event

Top Contributor
# 2
Top Contributor
Right now it looks like you're confused between a regular GA and a GTM implementation.
Which one would you like to focus on? There is no wrong approach but mixing the two might prove tricky.
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: How do I add Custom Dimensions to GA Event

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆
I'm focusing on a standard GA implementation at the moment.
Marked as Best Answer.
Solution
Accepted by topic author Kudakwashe Z
November 2015

Re: How do I add Custom Dimensions to GA Event

Top Contributor
# 4
Top Contributor

You have 2 ways of sending your event with a value and custom dimensions

 

 

ga('send', {
  hitType: 'event',
  eventCategory: 'My Category',
  eventAction: 'My Action',
  eventLabel: 'My Label',
  eventLabel: 'My Value',
  dimension1: 'the value for my dimension'
});

or alternatively, and more elegant:

 

 

ga('send', 'event', 'My Category', 'My Action', 'My Label', 'My Value', {
'dimension1': 'the value for my dimension'
});

Or not use the custom dimension at all, since your're passing event value in either of the two snippets above.

Hope that helped.

 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

How do I add Custom Dimensions to GA Event

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

So once I add event tracking...  how do I view online how many times that event was triggered?

How do I add Custom Dimensions to GA Event

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Using the second approach, can I put there (inside object after My Value) more than one dimensions? 

Re: How do I add Custom Dimensions to GA Event

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Julien, how do I this with GTM?