🌍

Create geolocation-based popups

In this tutorial we will create a popup for our website based on Geographical location.

The plan is to see different popup based on country or even zip code.

The plan

We will need the followin ingredients for our campaign:

  1. Create popups (Focus items) for all variations.
  2. Create the dynamic contents that show the right popups
  3. Place the dynamic content into our website

1. The popups (Focus items)

Our goal will be to communicate 2 different delivery conditions:

Let's create two popups for our tutorial. One in English

image

And one in German:

image

Let's make a note of our focus item IDs:

image

2. The dynamic contents

Now we will create a dynamic content for each langauge variation which will display to the proper audience.

Let's make a new dynamic content and disable campaign based rendering:

image

We will name this content English Delivery Popup. The Requested slot name will be english-delivery-popup and the content will be just a special code : {focus=4}.

Here is how it should look:

image

Now we need to do our filtering, that allows us to display this content (which is really just a popup) to specific users. Go to the filter tab, that appeared in the previous step.

Choose the proper filtering rules:

image

Save the dynamic content and repeat the whole process. Make sure, you are using the right settings for the german version:

image

Here we will filter for Germany as a country:

image

Now we've got our new dynamic contents, let's place them!

3. Place the dynamic content into our website

In order to place the dynamic content into a tracked page, we need to add the following code exactly there where the content should appear:

<div data-slot="dwc" data-param-slot-name="english-delivery-popup"> </div>

Please note, the data-param-slot-name is the "Requested slot name" in our previous settings. This is how the dynamic content is requested.

In this specific case, we must add both slots to our page, right under the <body> tag:

image

By using these settings we will ensure, that both dynamic contents are requested, but only the ones will be shown, which supposed to be shown based on the filter settings.

Do you have any questions? We are happy to help you via πŸ“§ email, ☎️ phone and πŸ‘©β€πŸ’» video calls.

Click here to go back to the main help page:

Friendly AutomateFriendly Automate