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

# Testing your On-site Messaging Campaigns

> Preview and test your On-site Messaging campaigns before going live. MoEngage's Test Campaign feature shows how messages appear on real devices.

# Overview

You should test your On-site Messaging (OSM) campaigns during creation. This ensures that the messages appear as expected on different devices and browsers. The message may display differently on your website than in the dashboard preview. Use the **Test Campaign** feature to preview on-site messages on your devices before activating them.

## Access the Test Campaign Feature

The **Test Campaign** feature is on the second step of campaign creation. See the following image:

<img src="https://mintcdn.com/moengage/VqQHPleQ9qk_ZsLR/images/moengage_55a875.png?fit=max&auto=format&n=VqQHPleQ9qk_ZsLR&q=85&s=d8b14dd319df491aa65c6426c6b2ff95" alt="Screenshot showing the Test Campaign feature in the MoEngage dashboard." width="1440" height="816" data-path="images/moengage_55a875.png" />

## Use the Test Campaign Feature

The **Test Campaign** feature lets you see how your on-site messages will look on your website. To send a test message to your device before you activate the campaign for live users, follow these steps:

1. On the **Test Campaign** section during campaign creation, paste the URL where you want to view the campaign.
   <img src="https://mintcdn.com/moengage/N1a7P_mcSpm-5bMa/images/moengage_56ff40.png?fit=max&auto=format&n=N1a7P_mcSpm-5bMa&q=85&s=b6fa6af1dfdd244f49d7812e063c0628" alt="Screenshot showing the URL input field for a test campaign." width="1440" height="816" data-path="images/moengage_56ff40.png" />
2. Make sure the MoEngage SDK is integrated on the target URL for the test campaign to display.
3. Click the **Test Campaign** button. A new tab opens in the same browser, and the on-site message displays there. This test message is only visible in the browser where you clicked the button in the MoEngage dashboard; it is not visible to your other website visitors.
4. Test campaigns remain active for 30 seconds. During this time, the campaign displays in the same browser even after you refresh the page. This behavior differs from live campaigns.

## Test on Mobile Web Devices

You can use one of these options to test campaigns on mobile web devices:

<Tabs>
  <Tab title="Test Using Chrome Device Mode">
    To simulate with Chrome's device mode, follow these steps:

    1. In your Chrome browser, open your website and then open **Developer Options**.
           <img src="https://mintcdn.com/moengage/4hNKOAjPrnhpJB2_/images/moengage_7f64d2.png?fit=max&auto=format&n=4hNKOAjPrnhpJB2_&q=85&s=5ff9a1212c87a179f7e5c8cf9a844546" alt="Screenshot showing how to open developer options in Chrome." width="1440" height="843" data-path="images/moengage_7f64d2.png" />
    2. Switch your website to mobile web view.
           <img src="https://mintcdn.com/moengage/60BzFdXTJDO5dnCb/images/moengage_37058e.png?fit=max&auto=format&n=60BzFdXTJDO5dnCb&q=85&s=ae873c27101b433908b35dd9c0bcd1ca" alt="Screenshot showing how to switch to mobile view in Chrome developer tools." width="1439" height="816" data-path="images/moengage_37058e.png" />

    **Note:** This method provides an approximation. Results may not always be precise. For more information, see [Chrome Device Mode](https://developers.google.com/web/tools/chrome-devtools/device-mode).
  </Tab>

  <Tab title="Test Using a Dummy URL">
    To test a dummy URL with a live campaign, create an OSM campaign with the following settings:

    1. In Step 1 of campaign creation, select a specific page and add a dummy source parameter to its URL, such as `?source=moe\_onsite\_test`. This ensures that the campaign is limited to a webpage that live users cannot access.
           <img src="https://mintcdn.com/moengage/t_8awpRKFC9RNHlT/images/moengage_ab1c76.png?fit=max&auto=format&n=t_8awpRKFC9RNHlT&q=85&s=55e4f532c2f1bcd582b4a7be61c32d68" alt="Screenshot showing the dummy source parameter added to a URL in campaign settings." width="839" height="228" data-path="images/moengage_ab1c76.png" />
    2. For more information, see [Create an OSM Campaign](/user-guide/campaigns-and-channels/on-site-message/create/create-osm-campaign).
    3. In Step 2, define the content of the OSM.
    4. Publish the campaign. Then, access the dummy URL from your mobile browser to see how your OSM message displays on your mobile website.
    5. Edit the campaign as needed to adjust its display.
  </Tab>
</Tabs>

# Next Steps

* [Analyze OSM Campaigns](/user-guide/campaigns-and-channels/on-site-message/analyze/analyze-on-site-messaging-campaigns)
