Tutorial 2x Enable User-ID tracking in Google Analytics for Xenforo

olalavui

Private
Tham gia
26/04/2015
Bài viết
20
Được Like
8
Tút này không mới nhưng sẽ hữu ích cho ae nào mới lọ mọ XF

Step 1: Làm theo hướng dẫn tạo User-ID View mới https://support.google.com/analytics/answer/3123666?hl=en
Step 2: Login Xenforo Admin -> Appearance -> Templates -> tìm template name: google_analytics
Tìm đoạn:
Mã:
<xf:if is="$xf.options.googleAnalyticsAnonymize"> 'anonymize_ip': true,
</xf:if>
Thêm vào bên dưới
Mã:
<xf:if is="{$xf.visitor.user_id}"> 'user_id' : '{$xf.visitor.username}',
</xf:if>

Hết tút, ae check lại kết quả trên GA + view-source XF của ae nhé
Reference
  1. https://support.google.com/analytics/answer/3123666?hl=en
  2. https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id
  3. https://xenforo.com/community/resources/conditional-statements-for-xenforo-2.5795/
Source: Học viện nhà bán hàng : Enable User-ID tracking in Google Analytics for Xenforo
 
Sửa lần cuối:

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom