XenForo Tutorials

Enable User-ID tracking in Google Analytics for Xenforo

Submitted by olalavui, , Thread ID: 201248

olalavui
Newbie
Level:
0
Reputation:
0
Posts:
16
Likes:
1
Credits:
20
21-03-2021, 08:16 PM
#1
This tutorial will help you enable tracking User-ID features in Google Analytics (default in Xenforo only tracking pageview & auto event by Google)

Step 1: Follow guide on https://support.google.com/analytics/ans...3666?hl=en to create new User-ID View on GA.
Step 2: Login your Xenforo Admin -> Appearance -> Templates -> find template name: google_analytics
Find
Code:
<xf:if is="$xf.options.googleAnalyticsAnonymize"> 'anonymize_ip': true,
</xf:if>
Add below:
Code:
<xf:if is="{$xf.visitor.user_id}"> 'user_id' : '{$xf.visitor.username}',
</xf:if>

Done tutorial, you can check result via view-source.
Reference

RE: Enable User-ID tracking in Google Analytics for Xenforo

BadWasabee
Lurker
Level:
0
Reputation:
0
Posts:
9
Likes:
0
Credits:
9
24-06-2021, 06:26 PM
#2
Great! Im ready to start seeing statistics on my users

Users browsing this thread: 1 Guest(s)