ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Web banners: displaying and testing a web banner to a segmented audience

Prerequisites for web banners

To work with web banners, first, they need to be set by the Meiro team:

1. Meiro Events must be implemented. 

2. Meiro Events API connection must be set in the Administration/ Settings tab. 

3. Web banners tabs must be enabled by the administrator for your user role.

4. For embedded web banners it is required to place a DOM element with a unique ID in the HTML code of the website where the banner will be displayed.

To use segments with web banners, there are additional requirements:

1. The relevant segment must be created in the Segments tab.

2. The Meiro User ID attribute must be added to WBS - Please contact the Meiro team to set this up.

1.1 Select condition: “Segment”.

1.2 Select the segment of your choice you wish to display a web banner to.

1.3 Select “Identifier attribute” which is an attribute used for profile stitching that helps to identify the user.

Usually, it is “Meiro User Id”.

1.4 Select operator “is in segment/ is not in segment”.

1.5 Select “Identifier location” (cookie / local storage) and insert a “key”. Those values are Meiro user IDs tracked from the client website where Meiro SDK is deployed.

In most cases, it is a cookie, key:  meiro_user_id

Key can be found in the Developers tools> Application> Cookie/ Local storage> Key

Warning: Setup for identifier attribute/ location and key can be custom to your use case, therefore please contact the Meiro team.


2. Second method 

Screenshot 2022-03-01 at 11.39.11 AM.png

  1. In the web banner settings form, insert as condition Server: HTTP request
  2. Input a URL to the URL template field.
    URL should look like this:

Condition to show the banner only to customers belonging to the particular segment:
response is ok


Condition to show the banner only to customers not belonging to the particular segment:
string - contains - status - error



Explanation of each part of the URL:

URL part

Meaning

cdp.qbank.meiro.io

This is the URL of your CDP instance.

cdp.<client_instance_name>.meiro.io

wbs

The CDP path that Meiro Events will access when a user visits your website. Do not modify this URL part.

attribute=ps_meiro_user_id

The Attribute ID contains the Meiro User IDs of your customers. Check it in Setup ->  Attributes -> Attribute detail tab of your Meiro Business Explorer instance.

Screenshot 2022-03-01 at 11.42.59 AM.pngScreenshot 2022-03-01 at 11.42.59 AM.png

value={{cookie:meiro_user_id}}

The field name usually contains the Meiro User IDs of your website cookie.

Usually, it should be meiro_user_id but it may change depending on the implementation.

You can find this field name when you visit your website, go to Dev Tools -> Application -> Cookies.

Screenshot 2022-03-01 at 11.57.35 AM.png

segment=567

The segment ID of the segmented audience that you wish to display the web banner to.


You can retrieve this number from: 

the URL of your segment

Screenshot 2022-03-01 at 11.58.44 AM.pngsegment detail

image-1652980340620.png

3. How to test a web banner for segmented audience

To test a web banner for only a certain segment of customers, it is necessary to set the meiro_id cookie of someone belonging to the segment.


For example:example, the banner is being displayed only to people from the segment with ID 490.

Screenshot 2021-12-22 at 5.23.48 PM.png


Warning: We strongly advise using only the fresh anonymous windows for testing different cookies!


1: Open the segment with the corresponding ID.

Screenshot 2021-12-22 at 5.24.00 PM.png


2: Open a single customer view of someone from this segment.

Screenshot 2021-12-22 at 5.24.12 PM.png


3: Copy to clipboard Meiro user ID.

Screenshot 2021-12-22 at 5.24.20 PM.png


4: Methods of testing:

First method by changing cookies manually:

Visit the URL when the banner is being displayed and open Developer Tools of the browser. Go to Application tab and change the cookie value manually for both 'meiro_user_id' and 'meiro_user_id_js'.


Screenshot 2021-12-22 at 5.24.32 PM.png

Learn more: about how to open Developer Tools on Chrome, Safari, Microsoft Edge, Firefox


Second method through the console input:

document.cookie="meiro_user_id={{meiro_id_cookie_value}};domain=.{{your_domain}};path=/;secure;samesite=strict"

document.cookie="meiro_user_id_js={{meiro_id_cookie_value}};domain=.{{your_domain}};path=/;secure;samesite=strict"


5: Hard refresh (CTRL + F5) your browser and the web banner will be displayed.