> ## Documentation Index
> Fetch the complete documentation index at: https://help.coachiq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Add analytics and tracking to your app

> Add Google Analytics, a Facebook Pixel, script links and your own JavaScript to your app on the web.

> [!NOTE]
>
> **Where to find this:** **Website & App › App**, then **Scripts & Analytics** under **App**. In the builder it's **Settings › Scripts & Analytics**, and the page is titled **Scripts & analytics settings**.

Add Google Analytics, a Facebook (Meta) Pixel, script links and your own JavaScript to your app on the web. The page has three parts: **Analytics**, **External scripts** and **Custom JavaScript**. Click **Update** at the top right to save any of them.

![Scripts & analytics settings with Analytics, External scripts and Custom JavaScript](https://mintcdn.com/coachiq/wB_pger7aJoBEfao/images/app-builder-scripts-analytics-2026-11.png?fit=max\&auto=format\&n=wB_pger7aJoBEfao\&q=85\&s=f8d2ad9aede4f5cc9ca77594d834c978)

> [!NOTE]
>
> These run only in your app on the web (in a browser). The iPhone and Android apps don't run custom scripts. Your website has its own Scripts & Analytics settings; see [Website analytics & tracking](https://help.coachiq.io/website/analytics-tracking/analytics-tracking.md).

## Adding Google Analytics

Track athlete behavior, page views, and engagement metrics with Google Analytics.

### Get your Measurement ID

**1. Open Google Analytics**

Go to [analytics.google.com](https://analytics.google.com) and sign in.

**2. Access Admin settings**

Click the **Admin** gear icon in the bottom left corner.

**3. Open Data Streams**

Under **Property Settings**, click **Data Streams**.

**4. Get or create a Web stream**

Select your existing web stream, or click **Add stream** → **Web** to create one.

Enter your app's web address (shown on **Website & App › App**, for example `app.coachiq.io/your-org/your-group`).

**5. Copy the Measurement ID**

Copy the **Measurement ID** - it starts with `G-` followed by letters and numbers (e.g., `G-ABC123XYZ`).

> [!TIP]
>
> You only need the Measurement ID, not the full script code. CoachIQ handles the script injection automatically.

### Add to CoachIQ

**1. Paste your Measurement ID**

In the **Analytics** section, paste your Measurement ID into the **Google Analytics** field.

**2. Save your changes**

Click **Update** in the top right corner.

> [!TIP]
>
> Google Analytics now runs on your app on the web.

### Check it's working

**1. Open Google Analytics Realtime**

In Google Analytics, go to **Reports** → **Realtime**.

**2. Open your app**

In another browser tab, open your app on the web.

**3. Check for activity**

You should appear as an active user in the Realtime report within a few seconds.

## Adding Facebook Pixel

Track conversions and build retargeting audiences with Facebook Pixel.

**1. Get your Pixel ID**

In Meta Business Suite, go to **Events Manager** → **Data Sources** → your Pixel.

Copy the **Pixel ID** (a string of numbers, e.g., `1234567890123456`).

**2. Add to CoachIQ**

In the **Analytics** section, paste your Pixel ID into the **Facebook Pixel** field.

**3. Save your changes**

Click **Update**.

**4. Check the pixel fires in your app**

In Meta **Events Manager**, open **Test Events** and open a page of your app (your sign-up link, a form link or the Schedule page) in a browser. A PageView should appear within a few seconds.

> [!NOTE]
>
> Your app fires the pixel separately from your website. If your website shows events in Test Events but your app doesn't, check the Pixel ID is saved here in the App builder's **Scripts & Analytics**, not only in the website builder.

## Adding External Scripts

Load third-party JavaScript libraries by URL. Use this for tools like Hotjar, Intercom, Drift, or any service that provides a script URL.

**1. Get the script URL**

From your third-party tool, copy the script source URL (starts with `https://`).

**2. Add the URL**

In the **External scripts** section, paste the URL into the **Script Source URL** field.

**3. Add more scripts (optional)**

Click **+ Add Script Source** to add additional script URLs.

**4. Save your changes**

Click **Update**.

> [!WARNING]
>
> **Only add scripts you trust.** External scripts can read and change everything on your app's pages. Only use scripts from reputable services.

## Adding Custom JavaScript

Run your own JavaScript code for advanced integrations, custom tracking events, or specialized functionality.

**1. Write your code**

In the **Custom JavaScript** section, paste your code.

> [!TIP]
>
> You can paste plain JavaScript or a full `<script>` snippet.

**2. Save your changes**

Click **Update**.

### Example: Custom event tracking

```javascript theme={"theme":"github-dark"}
// Track when athletes click specific buttons
document.addEventListener('click', function(e) {
  if (e.target.matches('.book-session-btn')) {
    gtag('event', 'book_session_click', {
      'event_category': 'engagement'
    });
  }
});
```

## Common questions

> [accordion] Does this work on the mobile apps?
>
> No. They only run in your app on the web, in a browser. The iPhone and Android apps don't run custom scripts.

> [accordion] Can I add multiple analytics tools?
>
> Yes. You can use Google Analytics, Facebook Pixel, multiple external scripts, and custom JavaScript all at the same time.

> [accordion] Why isn't my tracking showing data?
>
> Common causes:
>
> * **Not saved:** make sure you clicked **Update**
> * **Ad blocker:** turn it off while testing
> * **Wrong ID:** Google Analytics IDs start with `G-`; Pixel IDs are numbers only
> * **Old page:** do a hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
> * **Pixel set only on the website:** the website builder and the App builder each have their own Scripts & Analytics. Add the Pixel ID here too
> * **Testing in the mobile app:** scripts only run on the web; open your app in a browser to test

> [accordion] Do I need to add the full Google Analytics script?
>
> No. Just paste your Measurement ID (e.g., `G-ABC123XYZ`) into the Google Analytics field. CoachIQ automatically loads and configures the tracking script for you.

> [accordion] What's the difference between External scripts and Custom JavaScript?
>
> * **External scripts** load a JavaScript file from a web address (for third-party tools).
> * **Custom JavaScript** runs code you paste in.

> [accordion] Will this affect my website tracking?
>
> No. These settings only apply to your app. Your website has its own Scripts & Analytics in the website builder.

## Related articles

* [Your app overview](https://help.coachiq.io/app/overview.md)
* [Website Analytics & Tracking](https://help.coachiq.io/website/analytics-tracking/analytics-tracking.md)
* [Design settings](https://help.coachiq.io/app/design-settings.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.