I'm trying to migrate from Google old Analytics to Universal Analytics. I have code below and from universal - developers guide I couldn't find solution.
Inside my analytics code I had these lines. Part 1:
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-123456-1']);
_gaq.push(['_trackPageview','/tools/one');
_gaq.push(['_setCustomVar', 1, 'name', 'michael', 1]);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
Also inside my some other script I have this code snippet. Part 2:
if (typeof _gaq !== "undefined" && _gaq !== null) {
_gaq.push(['_trackPageview', '/dosomework']);
}
How can I convert "gaq.push"s inside 2 parts and add to my universal analytics code ?