Set up First-party mode

This document is for users who want to deploy the Google tag in first-party mode. We recommend First-party mode for the most durable tag configuration.

Overview

First-party mode lets you deploy a Google tag using your own first-party infrastructure, hosted on your website's domain. This infrastructure sits between your website and Google's services. The setup in this documentation will help you better measure your website. You can set it up using your existing Content Delivery Network (CDN), load balancer, or web server.

In standard Google tag setups, your web page requests a Google tag from a Google domain. When the tag fires, it sends measurement requests directly to the Google product. In First-party mode, your website loads the Google tag from your first-party domain. When the tag fires, it sends measurement requests to your first-party domain, where they are forwarded to the relevant Google product.

This diagram represents the information flow in First-party mode:

First-party mode architecture information flow.

Before you begin

This guide assumes that your website is already configured with:

To get started, pick your setup type.

Pick pick a setup type to see instructions.

Test the measurement set up

To test the measurement set up, configure your container to have at least one tag that fires.

  1. Go to Tag Assistant and preview your container. Navigate through your site to trigger events.

  2. In the Summary > Output > Hits Sent tab, verify that the hits are routed to /metrics.

    Screenshot verifying the setup