Source: https://datafa.st/docs/wordpress
Markdown source: https://datafa.st/docs/wordpress.md
Description: How to add DataFast to your website using WordPress

# Add DataFast to your WordPress site

Follow these steps to integrate DataFast analytics into your WordPress site.

## Method 1: Using the DataFast plugin (Recommended)

1.  Log in to your WordPress admin dashboard.
2.  Navigate to **Plugins > Add**, search for **"DataFast"** and install the plugin by contributor named "justshipit".
![WordPress plugin installation step 1](/blog-wp-onboarding-1.jpg)
>  If you prefer, you can download and install the official [DataFast plugin](https://wordpress.org/plugins/datafast/) manually.

3.  Open the plugin settings page (under **Settings > DataFast** in the sidebar).
4.  Enter your **DataFast ID** (e.g. `dfid_******`) from your DataFast website settings, then save.

![WordPress plugin installation step 2](/blog-wp-onboarding-2.jpg)

After a few minutes, you should start seeing pageviews from your WordPress site in your [DataFast dashboard](/dashboard).

## Method 2: Manually adding the script (Advanced)

> **warning:** This method requires basic knowledge of PHP and WordPress theme structure. Always back up your theme files before making changes. Changes might be overwritten by theme updates if you are not using a child theme.

1.  In your WordPress admin dashboard, go to **Appearance > Theme File Editor**.
2.  Select your active theme.
3.  Find and open the `header.php` file (Theme Header).
4.  Paste your DataFast tracking script just before the closing `</head>` tag:

    ```html
    <script
      defer
      data-website-id="dfid_******"
      data-domain="your_domain.com"
      src="https://datafa.st/js/script.js"
    ></script>
    ```

    > Replace `dfid_******` with your actual Website ID from DataFast.
    > Replace `your_domain.com` with your website's root domain.

5.  Click **Update File**.

## Verify installation

After implementing either method:
- Visit your live website.
- Check your [DataFast dashboard](/dashboard) for incoming data. It might take a few minutes for the first pageviews to appear.

> For advanced configuration options like localhost tracking, custom API endpoints, or cross-domain setup, see the [script configuration reference](/docs/script-configuration).
