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

PVS

Generalissimo
Thành viên BQT
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

Hỗ trợ trực tuyến

Support Quảng cáo
Mr. San (PVS)

Skype chat, instant message

Mr. Tuấn (Blue)

Skype chat, instant message

Mr. Tuấn
0988 488 096
Mr. Trọng
0906 081 284
kinhdoanh@vnxf.vn

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Điện Lạnh Thịnh Phát
Top