Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Custom Dimension - Session Level

Posted on 2013-11-18
1
215 Views
Last Modified: 2016-02-24
Hello,

I do need help regarding the custom dimensions. Initially, I use to track product pages, category pages and my different payment methods with custom variables.

After implementing google universal analytics, I am facing an issue. Not able to track anything. Please help me out.

ga('create', 'UA-1111111-1', 'xyz.co.uk');
                              ga('set', 'dimension2', 'abc'); // Product Pages
                        ga('send', 'pageview');

ga('create', 'UA-1111111-1', 'xyz.co.uk');
                              ga('set', 'dimension1', 'xyz'); // Category Pages
                        ga('send', 'pageview');

I do wish to track category pages, product pages and my payment methods like (COD, BT,CC) etc.

Please do help me out.

Thanks

Percy
0
Comment
Question by:david_php
1 Comment
 
LVL 1

Accepted Solution

by:
93jordanaj earned 500 total points
ID: 39754120
Hi Percy,

First of all, have you set up the custom dimensions within Google Analytics (admin > custom definitions (under property) > custom dimensions)?

Once you've done this, you then need to reformat the code to send the data:

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-1111111-1', 'xyz.co.uk');
ga('send', 'pageview', {
  'dimension1': 'Category page here',
  'dimension2': 'Product page here',
  'dimension2': 'Payment method here',
});

Open in new window


You've used the 'set' method which updates the value associated with a given field. However, because you haven't sent it using the 'send' method there's nothing to set. What this above code does is set the tracker and sends dimension1, dimension2 and dimension3 to GA.

Hope this helps.

Alex
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

With a software solution, you always get to control email signatures and have the final say on the design - not an unrelated department or the uninterested end user.
Learn about the eCommerce marketing trends for the year ahead.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question