Within the document.ready()
function of the primary GSP layout in my application, I have included the following code:
var pageTitle = document.getElementsByTagName('title')[0].innerHTML;
if('index' == 'list') {
pageTitle += " Listing";
}
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)}ga.l=+new Date;
ga('create', 'UA-XXXXXXXX-1', 'auto', 'AppTracker', {
userId: 'uniqueUser',
campaignId: '123',
campaignSource: 'app',
campaignName: '123',
title: pageTitle
});
ga('send', 'pageview');
My intention is to utilize Google Analytics for tracking access to the application. However, currently, neither page titles nor campaignId / names are being displayed in our GA account. Any insights on what could be going wrong?
Thank you!