Solved

Custom Dimension - Session Level

Posted on 2013-11-18
1
220 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
[X]
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
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
One event, two days, a great line-up of speakers, and 48% female presence. Still have no idea what I’m talking about?
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 PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

623 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