Note

  • This feature is available in Pro, Expert and Enterprise plans (and during the trial)
  • Custom properties must be configured by someone with developing skills
  • If you're using Google Tag Manager and GTM variables, you can read this article instead

Introduction

Custom properties allow you to target your visitors by custom properties - properties that you set up yourself.

Let's say that we want to target visitors who:

  • are older than 25 years old,
  • are in the "travel" segment or in the "sport" segment,
  • and purchased something at least 3 days ago.

On your website, you can attach such properties to your visitors, so WisePops will be able to target these properties.

Data attached to your visitors are called Custom Properties.
Rules based on custom properties are called Custom Conditions.

You can also use the custom properties to personalize the content of your popups on the fly.

Defining Custom Properties

You can use JavaScript to attach custom properties to a visitor. A function wisepops() is available as soon as our code is executed.

wisepops("properties", customProperties, [reset]);
  • "properties" : String that indicates that you want to define custom properties. Leave it as it is.
  • customProperties : this is the dictionary of properties you know about the user, like email, name, age, etc.
  • reset (deprecated, optional) : Clear all previously stored properties. We now suggest to remove the previous properties by setting their value to null. This way, you control exactly which properties should be persistent, and which ones should be ephemeral.

Typically, when someone logs in, we will add the following code, right after the WisePops setup code:

wisepops("properties", {
    firstName: "Boris",
    country: "FR",
    age: 30,
    segments: "cinema,food,travel",
    lastPurchaseDate: "2017-05-02T15:52:01+02:00"
});

Defining Custom Conditions

To define your custom conditions, open your popup in the editor and click "Display Scenarios". Then, select "Custom Properties" (or "Ecommerce").
Then you can set up the conditions to be matched during the display scenario resolution: 

Formats of Custom Properties

Each property must be one of the following types:

  • String
  • Number
  • Date
  • Boolean

The custom properties dictionary is flattened into a 1 dimension object. If you set the following properties:

wisepops("properties", {
user: {
id: 42,
name: "Boris"
}
});

You will then be able to write conditions on the keys user.id and user.name

About the Date type and format

You can set up a property to the current date of the browser by doing:

wisepops("properties", {lastPurchaseDate: new Date()});

But you are also free to write dates as strings.
While various formats are handled, we suggest you follow the W3C standard:
2017-05-02T15:52:01+02:00 .
This is equivalent to 2017-05-02 15:52:01 CEST .
If no timezone is specified, dates will be handled as UTC.

Debugging and troubleshooting

We suggest you to define your custom properties just after the WisePops setup code. The definition of the custom properties must occur within 100 ms after the execution of our setup code. Otherwise, the resolution of the scenarios will occur without the update on your properties.

If the wisepops() function is not defined, please make sure that the WisePops setup code is executed first, and is up to date.
It should start with (function(W,i,s,e,P,o,p) .

You can also test your configuration.

Did this answer your question?