Tutorial 2x Enable User-ID tracking in Google Analytics - Bật theo dõi User-ID trong Google Analytics cho Xenforo 2

PVS

Super Moderator
Thành viên BQT
Tham gia
28/02/2015
Bài viết
16,735
Được Like
12,681
Enable User-ID tracking in Google Analytics - Bật theo dõi User-ID trong Google Analytics cho Xenforo 2

Hướng dẫn này sẽ giúp bạn bật tính năng theo dõi User-ID trong Google Analytics (mặc định trong Xenforo chỉ theo dõi số lần xem trang và sự kiện tự động của Google)

Bước 1: Làm theo hướng dẫn trên https://support.google.com/analytics/answer/3123666?hl=vi để tạo User-ID View mới trên GA.
Bước 2: Đăng nhập ACP -> Appearance -> Templates -> tìm template: google_analytics

Tìm:
HTML:
            <xf:if is="$xf.options.googleAnalyticsAnonymize">
                'anonymize_ip': true,
            </xf:if>

Thêm vào bên dưới:
HTML:
            <xf:if is="{$xf.visitor.user_id}">
                'user_id' : '{$xf.visitor.username}',
            </xf:if>

Vậy là xong, bạn có thể kiểm tra kết quả qua view-source.

Tài liệu tham khảo:
  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/
Chúc các bạn thành công.


Nguồn: Internet​
 

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