Introduction

First-party mode helps address challenges in analytics integration due to browser changes affecting third-party cookies. It ensures users have a solution so that measurement data will be routed through scripts hosted on their own website, as opposed to a script requested from Google servers. Enabling First-party mode offers improved measurement quality, regulatory compliance, and potential for enhanced first-party data control.

Server Requirements

Site Kit places a measurement.php file on your server at /wp-content/plugins/google-site-kit/fpm/. This file must be executable for First-party mode to function properly. While this is typically not an issue for most servers, certain strict server configurations may block the script. If you experience any issues, please contact your hosting provider to verify that the script is permitted to execute. 


How to Identify if the Script is Blocked

You can identify if the measurement.php script is blocked by checking the First-party mode toggle in the settings screen:

  1. Check the First-party Mode Toggle
  • Navigate to the Analytics/Ads Settings screen
  • If the toggle is disabled and accompanied by a warning message indicating server configuration issues, this may suggest that the measurement.php script is blocked or inaccessible.
  1. Review Site Health
  • Go to Tools > Site Health > Info in WordPress.
  • Check for notices related to First-party mode under the “Site Kit by Google” section:
    • First-party mode: Service healthy – This indicates whether your server can successfully connect to the Google endpoint for First-party mode.
    • First-party mode: Script accessible – This indicates whether the measurement.php script is accessible on your server.

What to Do if the Script is Blocked

  1. Check cURL and file_get_contents Availability
  • The script relies on cURL or file_get_contents for sending requests. Verify that your server has these PHP functions enabled.
  • If either of these is disabled, contact your hosting provider to enable the respective functionality.
  1. Contact Your Hosting Provider
  • Share the file path /wp-content/plugins/google-site-kit/fpm/measurement.php with your hosting provider and request assistance in allowing this script to execute.

Setting Up

First-party mode can be configured via a dashboard banner or by visiting your Site Kit settings if Google Analytics or Google Ads is already connected. 

Dashboard banner setup

A First-party mode banner notification will appear on the Site Kit dashboard that allows you to enable the feature if you already have Google Analytics or Google Ads connected via Site Kit. The banner will only be available if the server requirements are met. You can choose Enable First-party mode to enable the feature or Maybe later to dismiss the notification from the dashboard permanently. 

A screenshot of the Enable First-party mode banner notification 
First-party mode banner notification

After you enable First-party mode using the banner, a notice will appear on the Site Kit dashboard to confirm that the feature has been enabled. 

A success notification will appear once First-party mode is enabled via the banner

Settings page setup

First-party mode can also be enabled from within your Google Analytics or Google Ads settings within Site Kit, if you have either of these modules connected. To do this, go to Site Kit > Settings > Connected Services > Analytics > Edit or Site Kit > Settings > Connected Services > Ads > Edit and switch on the Enable enhanced measurement toggle.

First-party mode configuration within Google Analytics settings
First-party mode configuration within Google Ads settings

Enabling the First-party mode toggle in either the Analytics or Ads settings will automatically activate the feature across both modules if they are connected. Similarly, disabling the toggle in one module will seamlessly turn off the feature for both. 

First-party mode FAQs

What are the benefits of enabling First-party mode?

Enabling First-party mode enhances user privacy and data security by hosting the Google tag on your own domain. This gives you greater control over data collection and usage. Additionally, it can improve the accuracy of your measurement data, as the Google script is served directly from your domain rather than a third-party site, reducing the likelihood of script blocking or other data collection issues.

How do I know it’s enabled and working?

Your Site Health information will also display your First-party mode status (Tools > Site Health > Info > Site Kit by Google First-party mode: Enabled No/Yes).

Another way to confirm that First-party mode is enabled is to check your site’s source code and review the Google Analytics snippet. When the feature is enabled, the Google Analytics script responsible for tracking will use a measurement.php script loaded from your own domain, such as:

https://your-site-domain.com/wp-content/plugins/google-site-kit/fpm/measurement.php?id=GT-12345&s=/gtag/js

This replaces the standard https://www.googletagmanager.com/gtag/js script. You can find more details about this snippet by visiting this guide.

If you happen to enable First-party mode from the banner notification, a success banner will appear to notify you that the feature has been enabled. 

I’m checking the Google Analytics real time reporting tool, and I don’t see my site visits recording after enabling First-Party mode. 

Support for First-party mode via the real time reporting tool is not yet provided, however, there are plans to support this sometime soon. Visits to your site are included in standard Google Analytics reports, just not via the real time reporting tool. 

I encountered a “Your server’s current settings prevent First-party mode from working” message. What are the requirements? 

You’ll find the requirements by visiting the section above

I encountered a “First-party mode has been disabled due to server configuration issues” message. How can I fix this?

Something may have changed at host level, resulting in this error. You’ll find the requirements by visiting the section above. These must be met before you can enable First-party mode once more.  

Does it work on AMP URLs? 

If First-party mode is enabled and you’re using AMP, Google Analytics will still track your AMP URLs, but not using First-party mode. Instead, amp-analytics will be used. 

More Resources