1. Government Frontend Component Guide
  2. Meta Tags

Component

Meta Tags

Meta tags to provide analytics information about the current page

This takes a content-store links hash like object which it can then turn into the correct analytics identifier metadata tags.

The code which reads the meta tags can be found in static-analytics.js.

Search for usage of this component on GitHub

How it looks (preview all)

<meta name="govuk:analytics:organisations" content="&lt;D1&gt;&lt;D3&gt;&lt;EO3&gt;">

How to call this component

<%= render "govuk_publishing_components/components/meta_tags", {
  content_item: {
    links: {
      organisations: [
        {
          analytics_identifier: "D1"
        },
        {
          analytics_identifier: "D3"
        }
      ],
      worldwide_organisations: [
        {
          analytics_identifier: "EO3"
        }
      ]
    }
  }
} %>

Accessibility acceptance criteria

The analytics meta tags component should not be visible to any users.

Other examples

With world locations (preview)

<meta name="govuk:analytics:world-locations" content="&lt;WL3&gt;">
<%= render "govuk_publishing_components/components/meta_tags", {
  content_item: {
    links: {
      world_locations: [
        {
          analytics_identifier: "WL3"
        }
      ]
    }
  }
} %>