Better Analytics

Better Analytics 3.1.1

No permission to download
Is there a way to differentiate Adsense code for guest and logged users?
Conditional statements don't work.
 
So, I'm not having any luck with this. I'm not sure why. It's not tracking anything.

WoglRMS.png


I don't see any social interactions. I'm assuming all of this data should be appearing in the custom variables...?

I know it doesn't say anything about this, but do I have to do any sort of user definitions or edit segments? I haven't edited my analytics template so I'm just confused as to why this is not working.
 
A while ago. Doh! I just looked and see that I didn't update it. Dammit! Sorry for the stupid question then. Wow, can't believe I did that.

So then I have another question. GA is asking if I want to upgrade to the Universal Analytics. Is that something I should do and would it work with this?
 
Thanks for the help. Is there any bit of code I need to put in my social icons? I'm not using the xf default and added them through custom code in widget framework.
 
Does this track usergroups? Or would I have to modify your code to include this:
http://xenforo.com/community/resources/track-usergroups-in-google-analytics.726/

How would you set up a registration filter? It appears the registration process is all weird and when I go to test register, it brings me to login/login/ which doesn't seem right. Haven't seen any solutions anywhere in the forums but did see you comment on something back in 2013 (and I didn't want to bump it). If you could shed some light, that'd be great.

Thanks for answering all these questions.
 
No, it doesn't track usergroups... Not sure what a registration filter is... Something in Analytics?
Sorry, I meant goal and funnel. To see how many people get to the registration page and then back out essentially. Allowing us to do testing to see if we can improve conversion rates.
I started hacking at your code and I want you to look at it. I changed this:
HTML:
<xen:if is="{$xenOptions.googleAnalyticsWebPropertyId}"><script>_gaq=[["_setAccount","{$xenOptions.googleAnalyticsWebPropertyId}"],["_setSiteSpeedSampleRate",10]];<xen:if is="{$forum.node_id} > 0">_gaq.push(["_setCustomVar",1,"Forum","{xen:jsescape {xen:raw $forum.title}} ({$forum.node_id})"]);</xen:if>_gaq.push(["_trackPageview"]);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=!0;b.src="//stats.g.doubleclick.net/dc.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(b)})();

To:
HTML:
<xen:if is="{$forum.node_id} > 0">_gaq.push(["_setCustomVar",1,"Forum","{xen:jsescape {xen:raw $forum.title}} ({$forum.node_id})"]);</xen:if>_gaq.push(["_setCustomVar",2,"Usergroup",<xen:if is="{xen:helper ismemberof, $visitor, 1}">"Unregistered-1",<xen:elseif is="{xen:helper ismemberof, $visitor, 3}" />"Administrator-3",<xen:elseif is="{xen:helper ismemberof, $visitor, 4}" />"SuperModerator-4",<xen:elseif is="{xen:helper ismemberof, $visitor, 8}" />"Premium-8",<xen:elseif is="{xen:helper ismemberof, $visitor, 2}" />"Member-2",</xen:if>1]);_gaq.push(["_trackPageview"]);(function(){var b=document.createElement("script");b.type="text/javascript";b.async=!0;b.src="//stats.g.doubleclick.net/dc.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(b)})();

I took it from the page I linked above. I just don't know what that 1 is for after the last if statement. But, theoretically, I just need to define those custom variables in the settings and that should start tracking our users based on usergroups, correct? And should I change the _setCustomVar to 2 or is it ok to have it on 1 with what your code is doing?

EDIT: Sorry it is all on one line :(
 
Last edited:
You shouldn't have to change the code or add custom variables for that... since the registration URL is unique to registration, you should be able to do it normally with the goals and funnels.
 
You shouldn't have to change the code or add custom variables for that... since the registration URL is unique to registration, you should be able to do it normally with the goals and funnels.
Sorry, not a good combination of staying up late and fasting. My brain wasn't working too well last night.

I was asking what you put (if you do) for the registration funnel / goals. It seems xf is all over the place with their pages so it almost seems impossible to track it at this point.

As for the code edit, that was for adding usergroups to the code so you can track your membership breakdown.
 
I don't put anything in the registration funnel/goals... registration isn't a goal of mine, so... :)
That code I gave you has worked for tracking visitors by usergroup. I'm quite surprised as to what I'm seeing on my site, though I'm sure there are extra "guests" showing up for users who go to log in. Needless to say, it's quite great seeing the breakdown. I also get to see how active my premium users are and I'll be able to see month by month how many are using the site!!
 
Top Bottom