When setting up Site Kit and additional services, if Site Kit detects existing code for the service (e.g. Analytics, Google Tag Manager, and AdSense) that you are connecting, it will allow you to choose if you wish to have Site Kit place the necessary code snippet instead. If Site Kit does not detect any existing code snippet, it will place the necessary code snippet for you.

If you choose not to have Site Kit place the code snippet for you, you can still use Site Kit to view dashboard metrics. Site Kit will display data in the dashboard from the associated Google account/property/tag(s) that you selected during service setup.

NOTE: Allowing Site Kit to place the AdSense code snippet when it has already detected existing AdSense code means that your site will have AdSense code snippets placed twice. This could result in data being double tracked, so we recommend either removing existing code and then turning on Site Kit code placement in Site Kit > Settings or turning off the toggle to allow Site Kit to place code snippets during setup.

A tag for the selected property already exists

This message indicates that Site Kit has detected that the Google Analytics tag that you are trying to add via Site Kit has already been added to your site via another method. 

Site Kit has identified an existing Analytics tag
Site Kit has identified an existing Analytics tag

When this occurs, Site Kit will automatically set the Place Google Analytics code toggle to off to avoid duplication. If you wish to remove the tag as inserted elsewhere, you can do so and later ask Site Kit to insert the tag instead by going to Site Kit > Settings > Connected Services > Analytics > Edit > Place Google Analytics code.

An existing tag was found on the page

This message indicates that Site Kit has found an existing GA4 tag on your site.

An existing Analytics tag was found

If you choose not to remove the existing tag and allow Site Kit to insert a tag for the other property that you select, data will be tracked to both properties.

If you prefer to track data only for the property that you select in Site Kit, you will need to find and remove the existing tag.

An existing tag GTM-*** was found on the page

This message indicates that an existing Google Tag Manager snippet was found on your site.

Selecting a Google Tag Manager container, with a notice that a container already exists

You can choose to select the existing account and container if you wish. If selected, Site Kit will set the Let Site Kit place code on your site toggle to off to ensure that a duplicate Google Tag Manager snippet is not placed. Alternatively, you can select a different account and container that is associated with your Google Tag Manager account. Site Kit will then insert this container code snippet on your site as long as you’ve set the Let Site Kit place code on your site toggle to on.  

Removing existing code

If Site Kit finds existing code for one or more services, you may want to remove that code and instead let Site Kit place the appropriate code snippet for you. Code for Google services, such as Analytics tags, can be placed in a variety of ways. To find and remove code, please check:

  • Your theme configurations. Some themes include dedicated settings in the WordPress admin that allow you to add Analytics scripts. You can also check your theme’s customizer settings, which can typically be accessed via Appearance > Customization from your WordPress administrator dashboard. 
  • Google Tag Manager, as Google Analytics can be added as tags within GTM containers. Events will not be duplicated if Site Kit’s Analytics and Tag Manager modules insert a code snippet that is linked to the same Analytics data stream.
  • Your theme templates. These include your `header.php` and `footer.php` files, usually contained within your theme’s root directory. Be careful when checking these files, as changes can have major effects on your site. If you feel unsure about doing this, please check with your technical contact. 
  • Any plugins that allow you to insert header/footer scripts (e.g. Insert Headers and Footers) and/or allow you to add Analytics scripts (e.g. Monster Insights).
  • Any other third-party plugins with Google Analytics integration.

Once code is removed, you can go to Site Kit > Settings > Connected Services and click Edit for the service that you wish to have Site Kit place the code snippet for, then set the toggle for placing code to on.

Removing Site Kit-placed code

Site Kit-placed code snippets can be switched off if desired. Choosing to turn off code snippet placements means that Site Kit will not place code snippets for the selected Google service.

When you turn off Site Kit-placed code snippets for a service, it is still possible to use Site Kit to view related dashboard metrics if the necessary code snippet for that service has been placed by other means, such as manually or via another plugin. If you want to view associated data for these services in Site Kit, you can choose to connect to the service using the associated Google account, but not allow Site Kit to place the code snippet for them.

You can choose to switch these options back on in future and Site Kit will once again place the relevant code snippet. The code snippet placed by Site Kit will be removed if the Site Kit plugin is disabled or removed from your site.

To turn off code placement for a Site Kit service:

  1. Navigate to Site Kit > Settings > Connected Services and edit the service for which you wish to turn off code placement.
  2. Switch off the code placement option. See screenshots of options for each service below.

Analytics

Remove Analytics Code Toggle

AdSense

Remove AdSense Code Toggle

Tag Manager

Remove Tag Manager Code Toggle