# Hướng dẫn test tracking landing (SEO/Marketing)

Tài liệu này hướng dẫn test tracking trên 3 trang:

- `https://truemotocare.com/landing-membership/`
- `https://truemotocare.com/landing-bee/`
- `https://truemotocare.com/landing-physical-card/`

Mục tiêu: xác nhận event đã gửi đúng tên, đúng tham số và đúng `landing_variant`.

---

## 1) Chuẩn bị trước khi test

- Đăng nhập GTM container.
- Mở GA4 property (có quyền xem DebugView).
- Đóng các tab test cũ để tránh nhiều session.

Khuyến nghị:

- Test trên Chrome desktop.
- Tắt extension chặn script (adblock) trong phiên test.

---

## 2) Test bằng GTM Preview (Tag Assistant)

1. Vào GTM -> bấm `Preview`.
2. Nhập URL landing cần test -> `Connect`.
3. Khi trang mở, giữ cửa sổ Tag Assistant bên cạnh.
4. Thực hiện các thao tác theo checklist ở mục 4.
5. Sau mỗi thao tác, kiểm tra event trong Tag Assistant.

---

## 3) Test bằng GA4 DebugView

1. Vào GA4 -> `Admin` -> `DebugView`.
2. Giữ session GTM Preview đang kết nối.
3. Thao tác trên trang landing.
4. Kiểm tra event vào DebugView có đúng tên và params.

---

## 4) Checklist thao tác trên mỗi landing

Thực hiện theo đúng thứ tự bên dưới:

1. Vừa vào trang, không click gì:
   - Kỳ vọng có `landing_page_view`.

2. Click 1 nút `Mua Ngay` trong block sản phẩm:
   - Kỳ vọng có `landing_page_product_buy_click`.

3. Click 1 tab tên thẻ (nếu có tab):
   - Kỳ vọng có `landing_page_product_tab_click`.
   - Lưu ý: landing Bee có thể không có tab theo giao diện như 2 trang còn lại.

4. Vào section Benefits:
   - Click 1 nút số.
   - Click 1 tên quyền lợi (desktop).
   - Kỳ vọng có `landing_page_benefit_click`.

5. Vào section Guides:
   - Click 1 flow (Mua thẻ / Tải & đăng ký app / Sử dụng ưu đãi...).
   - Click 1 function trong flow.
   - Kỳ vọng có:
     - `landing_page_guide_flow_click`
     - `landing_page_guide_function_click`

6. Vào section App:
   - Click App Store hoặc Google Play.
   - Kỳ vọng có `landing_page_app_download_click`.

7. Reload trang hoặc rời trang:
   - Kỳ vọng có `landing_page_exit`.

---

## 5) Event cần có

Danh sách event chuẩn:

- `landing_page_view`
- `landing_page_exit`
- `landing_page_product_buy_click`
- `landing_page_product_tab_click`
- `landing_page_benefit_click`
- `landing_page_guide_flow_click`
- `landing_page_guide_function_click`
- `landing_page_app_download_click`

---

## 6) Params cần kiểm tra

### 6.1 Params bắt buộc cho mọi event

- `landing_variant`
  - `membership`
  - `bee_support`
  - `physical_card`

### 6.2 Params theo từng event

- `landing_page_exit`
  - `time_on_page_seconds`
  - `is_bounce`

- `landing_page_product_buy_click`
  - `product_id`
  - `product_name`
  - `product_slug`
  - `product_price`

- `landing_page_product_tab_click`
  - `product_index`
  - `product_name`
  - `product_slug`

- `landing_page_benefit_click`
  - `benefit_position`
  - `benefit_title`
  - `benefit_device`
  - `click_source`

- `landing_page_guide_flow_click`
  - `flow_name`
  - `flow_index`

- `landing_page_guide_function_click`
  - `flow_name`
  - `function_name`
  - `flow_index`
  - `function_index`

- `landing_page_app_download_click`
  - `platform`
  - `device`
  - `href`

---

## 7) Mẫu bảng kết quả Pass/Fail

Copy bảng dưới vào ticket/Notion để team tick nhanh:

| Trang | Bước test | Event kỳ vọng | Kết quả | Ghi chú |
|---|---|---|---|---|
| Membership | Vào trang | landing_page_view | Pass/Fail |  |
| Membership | Click Mua Ngay | landing_page_product_buy_click | Pass/Fail |  |
| Membership | Click tab thẻ | landing_page_product_tab_click | Pass/Fail |  |
| Membership | Click benefits | landing_page_benefit_click | Pass/Fail |  |
| Membership | Click guides | landing_page_guide_flow_click / landing_page_guide_function_click | Pass/Fail |  |
| Membership | Click tải app | landing_page_app_download_click | Pass/Fail |  |
| Membership | Reload/rời trang | landing_page_exit | Pass/Fail |  |
| Bee | Vào trang | landing_page_view | Pass/Fail |  |
| Bee | Click Mua Ngay | landing_page_product_buy_click | Pass/Fail |  |
| Bee | Click tab thẻ (nếu có) | landing_page_product_tab_click | Pass/Fail | Có thể N/A |
| Bee | Click benefits | landing_page_benefit_click | Pass/Fail |  |
| Bee | Click guides | landing_page_guide_flow_click / landing_page_guide_function_click | Pass/Fail |  |
| Bee | Click tải app | landing_page_app_download_click | Pass/Fail |  |
| Bee | Reload/rời trang | landing_page_exit | Pass/Fail |  |
| Physical | Vào trang | landing_page_view | Pass/Fail |  |
| Physical | Click Mua Ngay | landing_page_product_buy_click | Pass/Fail |  |
| Physical | Click tab thẻ | landing_page_product_tab_click | Pass/Fail |  |
| Physical | Click benefits | landing_page_benefit_click | Pass/Fail |  |
| Physical | Click guides | landing_page_guide_flow_click / landing_page_guide_function_click | Pass/Fail |  |
| Physical | Click tải app | landing_page_app_download_click | Pass/Fail |  |
| Physical | Reload/rời trang | landing_page_exit | Pass/Fail |  |

---

## 8) Kiểm tra nhanh bằng Console (tùy chọn)

Mở DevTools Console trên landing, chạy:

```js
window.dataLayer.filter((e) => e && e.event && e.event.startsWith('landing_page_'));
```

Nếu thấy event trả về và có `landing_variant` đúng thì tracking đang chạy.
