Custom Variables – How to add any custom rules to Connecto targeting

Connecto allows you to target users based on multiple criteria including Page URLs, Geolocation, Source (Search, Social, Direct etc), Repeat/First Time, Session Time, Time on Page, Scroll, Browser, Pages Viewed, Device (Mobile, Tablet, Desktop) in Session etc. All these targeting criteria work with our single javasript code and does not require any more information from you. You can use Connecto to use these targeting options and show targeted notifications/lead forms just at the right time.


What if you require deeper targeting based on your custom knowledge of the visitor. For example, if you have some offer that you need to show only to users signed up for your “Course A” free class in last one week. There is almost no way Connecto could guess whether a user meets this criteria without you telling us.


To solve this problem, we support Custom Variables that can be setup in two easy steps:

1. Send Custom Variables and Values to Connecto from the page

var _TConnecto = _TConnecto || {};
_TConnecto.licenseKey = 'YOUR_LICENSE_KEY';
_TConnecto.initConnecto = function() {
    _TConnecto.addVariable("signedUpForCourseA", "yes");
    _TConnecto.addVariable("signedUpInLastWeek", "yes");
}; // Don't forget to add semi-colon as minified version would otherwise create problem.

2. Add Targeting Based on Custom Variables to your Notification

Within your Edit Notification -> Targeting Screen, you can add Custom Variable(s) like these

How does the logic works?

If you don’t set any rules within this section, Connecto will ignore all custom variables on the page and continue as if they didn’t exist.

If you do set the rules in this section then Connecto will match a notification only if all the rules are matched. You can set rules like

isLogged 'Equals' true
ProductsBought 'Contains' Moto G
oldUser 'Exists'

Basically, you have complete freedom to match JSON fields, arrays and existence of certain variables.

And the best part is, all other targeting options work along with Custom Variables.


3 found this helpful