Can I have different scenario of the pop-in on my website


#1

Sorry for my bad english.
I would like to have different messages and scenario on my website.
I have a tv category, a radio one and a news one.
For example, I would like to show the pop-in straight in the TV category, on the 3rd page in the news category and straight in the radio.
Thanks


#2

Hello,

You can control the optin-dialog plugin yourself from the initialization options you give in the WonderPush SDK snippet code you include on each page.
Depending on the category of the page, you can provide different values for the triggers.

For the pages where you want to show the dialog after 3 pages:

WonderPush.init({
    // Your regular options, like webKey, optInOptions, etc.
    plugins: {
        'optin-dialog': {
            triggers: {
                minPages: 3,
            },
            title: "Would you like to subscribe to push notifications?",
            message: "You can always unsubscribe at any time.",
            positiveButton: "Subscribe",
            negativeButton: "Later",
        }
    }
});

For the pages where you want to show the dialog straight away:

WonderPush.init({
    // Your regular options, like webKey, optInOptions, etc.
    plugins: {
        'optin-dialog': {
            triggers: {
                // No field here means no restriction, it triggers right away!
            },
            title: "Would you like to subscribe to push notifications?",
            message: "You can always unsubscribe at any time.",
            positiveButton: "Subscribe",
            negativeButton: "Later",
        }
    }
});

Check the reference of the values you can pass to the triggers object for more insight about what you can achieve.

Remember that when you add a plugin via the initialization options, it completely overrides what you might have configured from the dashboard. In particular, you must specify all the text options or you’ll fallback to the defaults.

Best.