Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Bất cứ khi nào có người tải một trang trên trang web của bạn hoặc trang web đang hoạt động thay đổi trạng thái nhật ký duyệt web của họ, một sự kiện đo lường nâng cao có tên là page_view sẽ được gửi từ trang web của bạn đến Google Analytics. Vì sự kiện này được gửi tự động nên bạn không cần phải gửi dữ liệu lượt xem trang đến Analytics theo cách thủ công.
Tuy nhiên, khi muốn kiểm soát thủ công cách gửi lượt xem trang (ví dụ: ứng dụng trang đơn hoặc cuộn vô hạn), bạn có thể tắt lượt xem trang rồi gửi từ trang web của mình theo cách thủ công. Tìm hiểu cách Đo lường ứng dụng một trang.
Tài liệu này mô tả hành vi mặc định của lượt xem trang, sau đó hướng dẫn cách tự gửi lượt xem trang.
Để biết thông tin về cách đo lường lượt xem màn hình trên ứng dụng di động, vui lòng xem bài viết Đo lường lượt xem màn hình.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-09 UTC."],[[["\u003cp\u003eBy default, Google Analytics automatically sends a \u003ccode\u003epage_view\u003c/code\u003e event whenever a page loads or the browser history changes.\u003c/p\u003e\n"],["\u003cp\u003eFor single-page applications or websites with infinite scrolling, you might need to manually control how \u003ccode\u003epage_view\u003c/code\u003e events are sent to avoid duplicates or inaccurate data.\u003c/p\u003e\n"],["\u003cp\u003eTo manually send \u003ccode\u003epage_view\u003c/code\u003e events, first disable the default pageview measurement, and then use the \u003ccode\u003epage_view\u003c/code\u003e event with relevant parameters like \u003ccode\u003epage_title\u003c/code\u003e and \u003ccode\u003epage_location\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003epage_view\u003c/code\u003e event includes parameters like \u003ccode\u003epage_title\u003c/code\u003e and \u003ccode\u003epage_location\u003c/code\u003e, which by default are populated with the document title and URL, respectively.\u003c/p\u003e\n"]]],["The `page_view` event is automatically sent to Google Analytics when a webpage loads or its browser history state changes. This default behavior can be disabled for manual control, especially useful for single-page applications or infinite scrolling. When disabling the default `page_view`, you are responsible for manually sending them. Default `page_view` data include `page_title` and `page_location` which are set automatically. When sending manual pageviews, be sure to disable default behavior to avoid duplicate entries.\n"],null,["# Measure pageviews\n\nWhenever someone loads a page of your website or their browser history state is\nchanged by the active site, an [enhanced measurement\nevent](//support.google.com/analytics/answer/9216061#page_view) called\n`page_view` is sent from your website to Google Analytics. Since the event is\nsent automatically, you don't need to send pageview data to Analytics manually.\n\nHowever, when you want to manually control how pageviews are sent (e.g.\nsingle-page applications or infinite scrolling), you can disable pageviews and\nthen manually send them from your website. Learn how to [Measure single-page\napplications](/analytics/devguides/collection/ga4/single-page-applications).\n\nThis document describes the default pageview behavior and then how to send your\nown pageviews manually.\n\nFor information about how to measure screenviews on a mobile app, see [Measure\nscreenviews](//firebase.google.com/docs/analytics/screenviews) instead.\n\n\u003cbr /\u003e\n\n\ngtag.js Tag Manager\n\nBefore you begin\n----------------\n\nDefault behavior\n----------------\n\n| Name | Type | Required | Default value | Description |\n|------------------|-----------|----------|-----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `page_title` | `string` | No | [document.title](https://developer.mozilla.org/docs/Web/API/Document/title) | The title of the page. |\n| `page_location` | `string` | No | [location.href](https://developer.mozilla.org/docs/Web/API/Location/href) | The URL of the page. If you override `page_location`, the value must start with the protocol followed by the full URL; for example, https://www.example.com/contact-us-submitted. | **Note:** The default value excludes the fragment portion of the URL. |\n| `send_page_view` | `boolean` | No | `true` | Whether or not a pageview should be sent. |\n\nManual pageviews\n----------------\n\nWhen you want to manually control how pageviews are sent (e.g. single-page\napplications or infinite scrolling), do the following:\n\n1. [Disable pageview measurement](#disable_pageview_measurement)\n2. [Send the `page_view` event when appropriate](#page_view_event)\n\n| **Caution:** If you send manual pageviews without disabling pageview measurement, you may end up with duplicate pageviews."]]