Solved

Custom Dimension - Session Level

Posted on 2013-11-18
1
212 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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Read about how to approach blogging and about ways to do it right. Stand out from the crowd and let your knowledge be consumed by a large audience. This article aims to explain how your blog should look like,  the most important things to do while b…
Read about the 3 stages of the buyer's journey: awareness, consideration, and decision.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now