> ## 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.

# Message Users When They Enter a Location

# Introduction

As marketers, we want to leverage location-based communication (often called *geofencing*) to engage users effectively and drive desired actions. By targeting users within a specific radius of our store, we can encourage them to visit and explore products from their wishlist or cart, or inform them about exclusive in-store deals. Similarly, travel and hospitality applications can nudge users with relevant offers when they enter a new city, such as booking nearby hotels, cab services, or tour packages.

#### Advantages of location-based communication

* **Increased relevance and engagement**: By delivering messages and offers based on a person's location, campaigns become more relevant and engaging, leading to higher click-through rates and conversions.
* **Targeted marketing**: Location data allows businesses to reach the right people at the right time and place, maximizing the impact of marketing efforts and reducing wasted spend.
* **Boosted in-store traffic**: Location-based campaigns can encourage customers to visit nearby stores or attend local events, increasing foot traffic and sales.
* **Personalized experiences**: By understanding a customer's location, businesses can personalize their marketing messages and offers, creating a more tailored and engaging experience.
* **Improved customer retention**: Location-based campaigns can help businesses stay top-of-mind with customers and encourage repeat business by providing relevant offers and information based on their location.

We will achieve this use case by [creating a Push campaign](/user-guide/use-cases/push/message-users-when-they-enter-a-location#create-a-push-campaign) to send offers to users when they are within 5 km of your store.

# Expected Result

Users receive a push notification on their phones when they enter a defined location:

<img src="https://mintcdn.com/moengage/rcvpxihxIp--_HSE/images/moengage_943ef6.png?fit=max&auto=format&n=rcvpxihxIp--_HSE&q=85&s=f7c83ac5239071cfa64ab86c9ab8b5e4" alt="1.png" style={{ width:"62%" }} width="1224" height="880" data-path="images/moengage_943ef6.png" />

<Tip>
  * Your platforms must be integrated with MoEngage Android or iOS SDK. For more information, refer to the [Developer Guide](/developer-guide/introduction).
  * Events must be available in MoEngage to track the action of a user adding an item to their cart and related information such as the platform, added product’s ID, name, and price. In this example, we will name the event *Added to Cart*. To understand how to track events, refer to the [Developer Guide](/developer-guide/introduction).
  * [Geofence](/developer-guide/android-sdk/push/optional/location-triggered) must be integrated into your account.
  * The [Push channel](/user-guide/campaigns-and-channels/mobile-push/getting-started-with-mobile-push) must be configured.
</Tip>

# Create a Push Campaign

In this section, we will create a Push campaign that triggers messages when a user enters defined regions:

## Step 1: Target Users

1. On the left navigation menu in the MoEngage dashboard, click **Engage**, and then click **Campaigns**.
2. On the All campaigns page, click **+ Create campaign**.
3. Under **Outbound**, click **Push** > **Location Triggered**. <img src="https://mintcdn.com/moengage/epqsPEpMsGQCYy1r/images/moengage_5bfdcc.png?fit=max&auto=format&n=epqsPEpMsGQCYy1r&q=85&s=70fd9ece80bbee20d76339257ceae426" alt="locationtriggu.png" width="714" height="1624" data-path="images/moengage_5bfdcc.png" /> \
   You are taken to the first step, **Target users**, of defining your campaign.
4. Define your campaign with a name and tags. Enter the following details:
   1. **Team**: Select a team if your organization has teams enabled for your account. For more information, refer to [Teams in MoEngage](/user-guide/settings/account/team-management/teams-in-moengage).
   2. **Campaign name**: Enter a name for the campaign. For example, *Location Triggered Offers*.
   3. **Campaign tags**: Select the required campaign tags. <img src="https://mintcdn.com/moengage/CaPmX0z_ys8cr0ms/images/moengage_0743cc.png?fit=max&auto=format&n=CaPmX0z_ys8cr0ms&q=85&s=1370eed54e2d034fcd5d3306f78ee7cb" alt="11usecase1.png" width="2728" height="648" data-path="images/moengage_0743cc.png" />
5. Define your Geofence. While defining this, you can decide whether you want to show when a user enters, exits, or stays in this region for a defined time (this is only possible with Android).
   1. In the **Geofence** section, click **+ Add Geofence**. <img src="https://mintcdn.com/moengage/rlD8iAX6JQFx0hql/images/moengage_bb6259.png?fit=max&auto=format&n=rlD8iAX6JQFx0hql&q=85&s=719f7e0136be9954dd45ca5c08cafb25" alt="4usecase2.png" width="2744" height="324" data-path="images/moengage_bb6259.png" />
   2. On the Add Geofence page, in the **Geofence name** field, enter a name for the Geofence, for example, *Disneyland\_Park*.
   3. In the **Send notification when** list, select when you want to show the communication. For this example, select *User enters the Geofence*.
   4. In the **Notification responsiveness (only android)** lists, define your responsiveness as *5 Minutes*. This is essentially the frequency at which MoEngage checks whether the user has entered the defined region. <img src="https://mintcdn.com/moengage/T-dEj4C-7pywzBS3/images/moengage_a21f57.png?fit=max&auto=format&n=T-dEj4C-7pywzBS3&q=85&s=7219377123ad32155c5d88e054ccfa5f" alt="11usecase2.png" width="2750" height="1622" data-path="images/moengage_a21f57.png" />
   5. In the **Search for a place** search bar, search for the location of your store. For this example, select *Disneyland Park, Anaheim, CA, USA*.
   6. Define the radius below the map. <img src="https://mintcdn.com/moengage/rmgWdhG7TCISpEIz/images/moengage_d6154c.png?fit=max&auto=format&n=rmgWdhG7TCISpEIz&q=85&s=bb68a750ed2dd74d96b94721101e853b" alt="4usecase4.png" width="2184" height="1020" data-path="images/moengage_d6154c.png" />
6. Click **Done** to add the Geofence. This adds the fence, and you can check it from the Geofence section where you initially saw the **+ Add Geofence** button. <img src="https://mintcdn.com/moengage/E3HJVtaUzhrzFckK/images/moengage_93dc7d.png?fit=max&auto=format&n=E3HJVtaUzhrzFckK&q=85&s=5b3c42546dffdd28c127b32c715e937f" alt="5.png" width="2778" height="294" data-path="images/moengage_93dc7d.png" />
7. If you want to add more than one fence, click **+ Add Geofence** again and repeat the abovementioned process. If you want to edit something about the fence, click the edit icon and make the required changes. <img src="https://mintcdn.com/moengage/-X0av6ek9AEOUtsy/images/moengage_cb36b0.png?fit=max&auto=format&n=-X0av6ek9AEOUtsy&q=85&s=0f3f78b9d2b5e9a3ef8c5e3d96a0a2dc" alt="4usecase5.png" width="2730" height="338" data-path="images/moengage_cb36b0.png" />
8. In the **Target audience** section, click **Filter users by**, and then click the **User behavior** tab.
9. Select the condition *Has Not Executed* and then select the *Added to Cart* event in the last 30 days time, as shown below: <img src="https://mintcdn.com/moengage/iCae3l_a7eOJMTbz/images/moengage_221e79.png?fit=max&auto=format&n=iCae3l_a7eOJMTbz&q=85&s=1d7af94b98cc1dacb5ee679d61ca49d2" alt="11usecase3.png" width="2732" height="796" data-path="images/moengage_221e79.png" />
10. In the **Target Platforms** section, select **Android**. <img src="https://mintcdn.com/moengage/2FjM3dGfEH1CYo8k/images/moengage_693216.png?fit=max&auto=format&n=2FjM3dGfEH1CYo8k&q=85&s=fd60f89bb674a164cf81157ab9377d10" alt="11usecase4.png" width="2746" height="562" data-path="images/moengage_693216.png" />
11. Click **Next** to move to the second step, **Content**, where you can define the content for your Push campaign.

## Step 2: Content

1. Select the template that you would like to use. For our example, select **Basic notification**. <img src="https://mintcdn.com/moengage/MkyldVVKHHCZ-kMR/images/moengage_af4c49.png?fit=max&auto=format&n=MkyldVVKHHCZ-kMR&q=85&s=d949d84b0f24fba0827ec38bf1a14379" alt="11usecase5.png" width="2744" height="1296" data-path="images/moengage_af4c49.png" />
2. Enter the required content for the campaign. We can manually enter a title, message, and summary, or generate them using Merlin AI. For more information, refer to [Generate Push Messages with Merlin AI](/user-guide/intelligence/merlin-ai/merlin-ai-copywriter/generate-push-messages-with-merlin-ai). <img src="https://mintcdn.com/moengage/epqsPEpMsGQCYy1r/images/moengage_5cd8e0.png?fit=max&auto=format&n=epqsPEpMsGQCYy1r&q=85&s=c8a687bee334e4cefc04ef25c12c5a40" alt="11usecase6.png" width="1244" height="974" data-path="images/moengage_5cd8e0.png" />
3. Add personalization to the message using information such as the name of the user. Such personalization makes the message more contextual and makes the users feel connected. To do the same:
   1. Type *@*.
   2. On the **Push Personalization** dialog box, find your user attributes, such as Email, Google Advertising ID (Android), and first name. <img src="https://mintcdn.com/moengage/2kQqTYC5RUPSd8kI/images/moengage_40fd4b.png?fit=max&auto=format&n=2kQqTYC5RUPSd8kI&q=85&s=d4acfde507ab043c4669f045cbd461b9" alt="9.png" width="2092" height="1626" data-path="images/moengage_40fd4b.png" /> Clicking the first name makes the message content look something as follows: <img src="https://mintcdn.com/moengage/7H2dU4CG2W0DQCPI/images/moengage_6f79b8.png?fit=max&auto=format&n=7H2dU4CG2W0DQCPI&q=85&s=4c4cb033605db3a402ceeb8fdb657992" alt="11usecase7.png" width="2732" height="1448" data-path="images/moengage_6f79b8.png" />
4. Not all users can find your store from where they are. So you can do one of the following:
   * Add the link to your store from the deeplink option:
     1. In the **Default click action** list, select *Deeplinking*.
     2. In the **URL** field, enter the link to your store. <img src="https://mintcdn.com/moengage/xGyg9rXr6djolSrt/images/moengage_dc35b0.png?fit=max&auto=format&n=xGyg9rXr6djolSrt&q=85&s=7b938490dc30cb2da9d23b7618384019" alt="11.png" width="3378" height="898" data-path="images/moengage_dc35b0.png" />
   * Add an action button to link to your store:
     1. Expand the **Buttons** section and click **+ Action button**. <img src="https://mintcdn.com/moengage/fUSb9kG75-iJ0JuL/images/moengage_e406ac.png?fit=max&auto=format&n=fUSb9kG75-iJ0JuL&q=85&s=600e3199af31f2151a2537d76605a58e" alt="4usecase9.png" width="1874" height="264" data-path="images/moengage_e406ac.png" />
     2. In the **Button name** field, enter a name for the button. For example, *Take me there*.
     3. In the **Click action** list, select *Deeplinking*.
     4. In the **URL** field, enter the link to your store. <img src="https://mintcdn.com/moengage/4hNKOAjPrnhpJB2_/images/moengage_7faf28.png?fit=max&auto=format&n=4hNKOAjPrnhpJB2_&q=85&s=861895e597194490e03bc86314e8802e" alt="11usecase8.png" width="570" height="556" data-path="images/moengage_7faf28.png" />
5. Click **Next** to move to the third step, **Schedule and goals**, where you can define your campaign's schedule and goals.

## Step 3: Schedule and Goals

Location-triggered campaigns are always published as soon as possible. However, you can control when the message is shown based on certain time rules.

1. In the **Time bound for Geofences** section, select the **Limited period** option.
2. Click **+ Another time bound** to add more rules. <img src="https://mintcdn.com/moengage/MkyldVVKHHCZ-kMR/images/moengage_ad3d3b.png?fit=max&auto=format&n=MkyldVVKHHCZ-kMR&q=85&s=6ff3f4a759659be761c89cd83046033b" alt="11usecase9.png" width="2732" height="758" data-path="images/moengage_ad3d3b.png" />
3. In the **Conversion goals** section, add goals that you would like to track.
4. Define **Delivery controls** and **Advanced** settings based on your requirements. For more information, refer to [Create Push Campaigns](/user-guide/campaigns-and-channels/mobile-push/create/create-push-campaigns). <img src="https://mintcdn.com/moengage/8EX_gHAg3q4zA1kw/images/moengage_276b99.png?fit=max&auto=format&n=8EX_gHAg3q4zA1kw&q=85&s=cb532d83415d9d0e1412766d81a6ceb9" alt="14.png" width="5462" height="1934" data-path="images/moengage_276b99.png" />
5. Click **Publish**.

# Conclusion

In this use case, we created an effective Push campaign to nudge users with offers when they are within 5 km of our shop.
