> This page is part of the [Customer.io documentation](https://docs.customer.io). For the complete index, see [llms.txt](https://docs.customer.io/llms.txt).
> Last updated: September 1, 2026
> To take actions in Customer.io from an agent, use the [Customer.io CLI](https://docs.customer.io/ai/cli/get-started.md) or the [MCP server](https://docs.customer.io/ai/mcp/get-started.md).

# Integrating with Customer.io

While there are plenty of ways to get data into, and out of, Customer.io, our JavaScript integration is one of our most popular and easy-to-use integrations. On this page, we'll walk you through setting it up so you can identify your website visitors and send them in-app messages.

## 1\. Set up your JavaScript integration

Our JavaScript client feeds data from your website into Customer.io. You’ll add \*data in integrations for every system or touchpoint you want to collect data from.

1.  Go to *Integrations* and click **Add Integration**.
2.  Select our **JavaScript** integration.

     ![select the javascript source](https://docs.customer.io/images/cdp-add-js-source.png)

3.  Enter a *Name* for the integration and click **Submit**. You should give your integration a name that helps you and your teammates understand the resource you’re capturing data from—like “company website” or “community forums.”
4.  Under *Installation Instructions*, you’ll find the JavaScript snippet that you need to add to your website. Copy this code and paste it in your website’s `<head>` tag.
5.  Click **Test connection** to make sure that everything is setup correctly. If you want to skip this step, click *Save & complete later*. Otherwise, if your test is successful, click **Complete Setup**.

That’s it! Now you’re ready to capture data from your website.

## 2\. Make a page call

Go to the website where you installed the JavaScript snippet [in the steps above](#add-source) and visit a few pages. In Customer.io, go back to the *Data In* tab. You should see `page` events! These events represent the pages people visit on your website.

But these events are still anonymous. You’ll need to `identify` your audience to associate anonymous data with people you know. That’s what [we’ll do next](#identify).

Do you have a single page app?

The snippet automatically calls `cioanalytics.page()` when the snippet loads. If you have a single page app (SPA), it’s likely that each route isn’t necessarily a new page, so you’ll need to [call `cioanalytics.page()` manually for each route](/integrations/data-in/connections/javascript/method-reference/#page) in your app.

 ![see events flowing into Data Pipelines from your source](https://docs.customer.io/images/cdp-getting-started-source-events.png)

## 3\. Identify website visitors

You can identify profiles when they provide their email address on a form, log in to your website, and so on.

1.  In your console or in your code, you can call `cioanalytics.identify()` to associate anonymous data with a profile.

    ```
    // What a call typically looks like:
    // cioanalytics.identify('userId or email address', {
    //   attribute1: 'value1',
    //   attribute2: 'value2',
    // });

    // Realistic example:
    cioanalytics.identify('cool.person@example.com', {
       first_name: 'cool',
       last_name: 'person',
       favorite_color: 'blue',
    });
    ```

2.  Now refresh your page and look at the *API Calls* tab in your source. You should see an `identify` call and that your `page` calls are now associated with that profile!

Beyond identifying profiles and seeing the pages they visit, you can also send custom events, associate profiles with [custom objects](/journeys/objects-data/objects/), and more. See [our JavaScript source](/integrations/data-in/connections/javascript/) for help implementing the full array of events you can (and should) capture from your source.

## 4\. (Optional) Set up in-app message support

Now that you’ve identified profiles and captured page views, you can also set up and send your first in-app message!

1.  Go to [**Settings > Workspace Settings** > **In-App**](https://fly.customer.io/workspaces/last/settings/actions/in_app), and **Enable in-app messages**.

     ![The in-app settings page, with the enable in-app messaging button highlighted](https://docs.customer.io/images/in-app-enable.png)

2.  Click **Send a test message** in the in-app message settings and enter the email address or ID of [the profile you identified earlier](#identify). It may take up to a minute to get your first test message because we poll on a longer interval until you receive your first message, but you should see it shortly.

     ![The in-app message settings page, with the send a test message button highlighted](https://docs.customer.io/images/in-app-setup-test.png)

When you receive your first message, you’ll know that you’re properly set up to send in-app messages to the rest of your audience. Your JavaScript integration is complete, and working from end to end!

We support anonymous in-app messages too!

If you’re on a Premium or Enterprise plan, you can also send in-app messages to anonymous visitors to your website. See [anonymous messages](/messaging/channels/in-app/anonymous/overview/) for more information.

©2026 Peaberry Software, Inc. [Status](https://status.customerio.com/) [Terms of Service](https://customer.io/legal/terms-of-service/) [Privacy Policy](https://customer.io/legal/privacy-policy/)

[](https://www.linkedin.com/company/customer-io)[](https://twitter.com/customerio)[](https://www.youtube.com/channel/UCkCaWdezRoa8ZyR9pEVaipA)[](https://www.instagram.com/customer.io/)
