[null,null,["最后更新时间 (UTC):2024-02-06。"],[[["\u003cp\u003eTag Manager's server-side preview and debug mode allows you to inspect incoming HTTP requests from your website or app and understand how they are processed.\u003c/p\u003e\n"],["\u003cp\u003eThe debugger helps verify that the correct client is claiming requests, ensuring data is routed properly within your server container.\u003c/p\u003e\n"],["\u003cp\u003eYou can examine outgoing HTTP requests to vendor endpoints like Google Analytics 4 to confirm data is being sent correctly with the expected parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe debugger provides insights into tag firing status, variable values, and event data, enabling you to troubleshoot issues and ensure accurate data collection.\u003c/p\u003e\n"],["\u003cp\u003eThe console displays error messages related to tag execution, aiding in identifying and resolving problems within your server-side setup.\u003c/p\u003e\n"]]],["In Tag Manager, use the **Preview** mode to debug your server container. The left panel lists incoming requests and related events. The right panel provides details via tabs like **Request**, **Tags**, **Variables**, **Event Data**, and **Console**. The **Request** tab allows checking the claiming client, incoming and outgoing HTTP requests. **Tags** shows fired and unfired tags. **Variables** and **Event Data** provide detailed data and values, while **Console** shows tag errors.\n"],null,["# Preview and debug server containers\n\nYou can preview and debug your server-side container in Tag Manager.\n\nUnderstand the preview layout\n-----------------------------\n\nTo open the debugger, in Tag Manager select your server container and click\n**Preview**.\n\nThe left panel lists incoming HTTP requests, e.g. `collect?v=2&....`. If the\nclient that claimed the request created an event data object, e.g. `scroll`,\n`page_view`, `add_to_cart`, this event displays as a sub item under the request.\n\nThe tabs on the right include details about the item selected in the left panel.\nEach tab is discussed in a separate section.\n| **Note:** You can click any box in a tab to open a slider panel with full details.\n\n| **Note:** GA4 bundles events within one request and you may see more than one event under a top-level incoming request (`collect?v=...`). These events represent all events sent in that request. However, when you run your client-side container in preview mode at the same time, the hits are not bundled.\n\nDebug requests\n--------------\n\nThe **Request** tab contains boxes for the:\n\n- Client that claimed the request\n- Outgoing HTTP requests\n- Incoming HTTP request\n\n### Check the right client claimed the request\n\nServer containers can have many clients, but only one client can claim a\nrequest. The correct client recognizes the format of the request from the\nbrowser and claims it if there is a match.\n\nClick the **Client** box to check the client's details. This information should\ncorrespond with the client configuration in **Clients \\\u003e *Client name***.\n\n| **Note:** The client that claimed the request is not necessarily the client that generated the event data.\n\n### Check incoming requests\n\nClick the **Incoming HTTP Request** box to view the full details of the incoming\nrequest.\n\nThe request (`collect?v=...`) should be a 1:1 representation of what you see in\nthe Chrome network tab. Confirm that what you see in the browser is a match and\nthat the server container is receiving the right parameters.\n\n| **Note:** AppEngine appends additional headers that do not show up in the browser. Other cloud services may also append their own data.\n\n### Check outgoing requests\n\nClick any **Outgoing HTTP Requests** box to view details about the:\n\n- Tag that generated the request\n- Outgoing request\n- HTTP response returned by the vendor endpoint\n\nThe outgoing request details show the data sent by the server container to the\nvendor endpoint.\n\nThe Response shows the status code, headers and body (if any) returned by the\nvendor endpoint.\n\nDebug tags\n----------\n\nThe **Tags** tab lists all configured tags:\n\n- **Tags Fired**: Tags fired by the event. Each box indicates whether the tag failed or fired successfully, and the number of times the tag fired.\n- **Tags Not Fired**: Available tags that did not fire.\n\nClick any box to view the tag properties, outgoing HTTP requests and firing\ntriggers.\n\nRead [How to build a server tag](/tag-platform/tag-manager/server-side/how-to-build-a-server-tag) for more information about configuring and\nimplementing server tags.\n\nDebug variables\n---------------\n\nThe **Variables** tag lists the event's variables and includes the variable\ntype, return type, and value. For example, the screenshot below for a\n`user-engagement` event shows the `var_screen_resolution` variable set to\n\"1536x864\".\n\nThe data used to set the variable values is shown in the [**Event Data** tab](#debug_event_data).\n\nRead [Variables](https://support.google.com/tagmanager/topic/7683268) for more information about configuring [built-in variables](https://support.google.com/tagmanager/topic/7182737) and\n[user-defined variables](https://support.google.com/tagmanager/topic/9125128).\n\nDebug event data\n----------------\n\nThe **Event Data** tab shows full details about the event. This data is used to\nset the variable values in the [**Variables** tab](#debug_variables).\n\nConsole\n-------\n\nThe **Console** tab shows all errors originating from fired tags. The log\nincludes each error message and its source, e.g. an invalid endpoint or target\nAPI call."]]