0
votes

I have some code (below) that I'm using to track pageviews on Google Analytics. In Google Analytics, all pages end up having the name "$A".

I can't seem to find anyone who has had the same issue and I can't see what I'm doing wrong:

<script type="text/javascript">


    (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);
    })();


    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
    _gaq.push(['_trackPageview']);

</script>

<script src="/__utm.js" type="text/javascript"></script>
1
The Urchin Tracking Module. The site is transitioning away from using Urchin and is now using GA. - HardlyNoticeable
I'm not too familiar with Urchin since it's been years since I used it, but is it possible that Urchin is interfering with GA? I would try removing it, at least on some test page and see what happens. - Michael Mior
Good Suggestion; but I've tried removing it [and waited for the report to update] but it didn't make any difference. - HardlyNoticeable
I tried replacing the _trackPageview line is something like this: _gaq.push(['_trackPageview', window.location.pathname]); - but the page name still shows us as $A - HardlyNoticeable
You shouldn't need window.location.pathname. Just _gaq.push(['_trackPageview']) should be sufficient. - Michael Mior

1 Answers

0
votes

It sounds like, rather than there being a problem with the tracking code, that the problem is actually with a filter configured for your account.

Specifically, $A makes it sound like you have an improperly configured Reyes based filter that, rather than outputting the regex match, is instead outputting the string "$A", which is meaningless unless you're properly using RegEx.

Can you post detailed information about the profile? In any case, you shouldn.t be filtering on a main profile, since filters cannot be undone, so any configuration errors on your main profile will result in permanently lost data.

My recommendation is to totally remove the filters in pladce, duplicate the profile and apply your desired filters against the duplicate, to mitigate potential data loss problems like this.