# Step 1: Embed Surface Tag



The Surface Tag needs to load on every page of your site. In WordPress you can
do this either with a plugin (recommended) or by editing your theme directly.

Check out the [**How to Get Site ID**](https://www.withsurface.com/docs/platform/traffic/surface-tag#where-to-find-your-site-id) page to get your site ID.

```html
<!-- Start Surface Tag -->
<script 
  src="https://cdn.jsdelivr.net/gh/trysurface/scripts@latest/surface_tag.min.js"
  site-id="YOUR_SITE_ID">
</script>
<!-- End Surface Tag -->
```

<Info>
  Using a verified custom domain? Add `data-custom-domain="forms.example.com"` to the Surface Tag. Follow the [custom-domain setup guide](https://www.withsurface.com/docs/platform/traffic/custom-domains) before publishing the change.
</Info>

<Tabs>
  <Tab title="Plugin (recommended)">
    Use a header/footer plugin such as [**WPCode**](https://wordpress.org/plugins/insert-headers-and-footers/):

    1. In your WordPress admin, go to &#x2A;*`Plugins`*&#x2A; > &#x2A;*`Add New Plugin`**.
    2. Search for **WPCode**, then **Install** and **Activate** it.
    3. Go to &#x2A;*`Code Snippets`*&#x2A; > &#x2A;*`Header & Footer`**.
    4. Paste the Surface Tag code above into the **Header** section.
    5. Replace `YOUR_SITE_ID&#x60; with your site ID and click &#x2A;*`Save Changes`**.

    Any plugin that injects code into the site `<head>` works the same way. If
    you already use one, add the Surface Tag there instead.
  </Tab>

  <Tab title="Theme File Editor">
    If your theme is a classic (non-block) theme, you can add the tag directly:

    1. Go to &#x2A;*`Appearance`*&#x2A; > &#x2A;*`Theme File Editor`**.
    2. Open &#x2A;*`header.php`** in the file list on the right.
    3. Paste the Surface Tag code right before the closing &#x2A;*`</head>`** tag.
    4. Replace `YOUR_SITE_ID&#x60; with your site ID and click &#x2A;*`Update File`**.

    <Warning>
      Theme file edits are lost when the theme updates. Use a child theme, or prefer
      the plugin approach.
    </Warning>
  </Tab>
</Tabs>

To verify the tag is installed, open your site, view the page source, and
search for `surface_tag`. You should find the script inside the `<head>`.
