Scenario examples

Base setup

Everything shared by all trigger scenarios. You do it once — without this step the individual scenarios will not work.

Frequency cap

The cap protects against a flood of pushes when someone matches several triggers at once.

Settings → Configuration → “Frequency cap”

FieldValueComment
ToggleOnWhile the cap is off, journeys run without a limit
Max pushes3A whole number from 1 to 50
Period24, unit hoursFrom 1 minute to 30 days

What is counted. Every message any journey creates for the user, even if it was not delivered. The window slides: before a push, the pushes of the last 24 hours are counted.

Never counted and never blocked: campaigns (the Messages section) and direct transactional messages — via the API or the Bitrix module (order, payment and delivery statuses).

💡
Start with “3 in 24 hours” and watch the “Skipped pushes” block in journey analytics. Many skips and few unsubscribes — the cap can go up. Unsubscribes growing — lower it to 2.

The frequency of one scenario (“at most once in N”) is not set here but in the journey itself — with the journey limit. It works independently of the app cap.

More on the limits in Journeys.

Tag conventions

All example scenarios follow the same tag scheme.

Trigger flags

The value 1 means the trigger fired and waits to be sent, 0 means inactive.

TagScenarioSets 1Sets 0
trg_chkAbandoned checkoutthe site: delivery or payment stepthe journey after the push; the site on purchase
trg_catCategory interestthe site: 3rd product of one category in a sessionthe journey after the push; the site on purchase
trg_cmpComparison without purchasethe site: 2 or more products in the comparisonthe journey after the push; the site on purchase
trg_sectionRepeat section visitsthe site: 2nd visit to the section within 7 daysthe journey after the push; the site on purchase
trg_brandRepeated brand searchthe site: 3rd search for a brand within 7 daysthe journey after the push; the site on purchase
ℹ️
Flags are reset with the value 0, not by deleting the tag. Every segment uses the condition “= equals” 1.

Context tags

They carry data for the push text and link; flags never touch them. Links are passed as absolute URLs, with the site domain.

TagExample valueUsed in
chk_urlhttps://example.com/checkout/Abandoned checkout
cat_nameLaptopsCategory interest
cat_urlhttps://example.com/catalog/laptops/Category interest
cmp_urlhttps://example.com/compare/Comparison without purchase
section_urlhttps://example.com/catalog/bundles/Repeat section visits
brand_nameAcmeRepeated brand search
brand_urlhttps://example.com/brands/acme/Repeated brand search

Site code

This is a task for the site developer. The code goes on every page — before or after the Notirix SDK code (or the Bitrix module): commands are queued and run once the SDK has loaded.

Shared helper

html
<script>
(function () {
  // Flags of the trigger scenarios you use: notirixPurchase() resets all of them
  var TRIGGER_FLAGS = ['trg_chk', 'trg_cat', 'trg_cmp', 'trg_section', 'trg_brand'];

  // Command for the Notirix SDK. Works before the SDK has loaded: commands are queued.
  function notirix(cmd) { (window.Notirix = window.Notirix || []).push(cmd); }

  function hoursSince(key) {
    try { var t = Number(localStorage.getItem(key)); return t ? (Date.now() - t) / 36e5 : Infinity; }
    catch (e) { return Infinity; }
  }

  /**
   * A scenario trigger fired.
   * flag          — flag tag (trg_chk, trg_cat, …)
   * context       — context tags for the push text and link
   * throttleHours — send this trigger at most once in N hours
   */
  window.notirixTrigger = function (flag, context, throttleHours) {
    var key = 'ntx_last_' + flag;
    if (hoursSince(key) < (throttleHours || 0)) return;
    try { localStorage.setItem(key, String(Date.now())); } catch (e) {}
    var tags = Object.assign({}, context || {});
    tags[flag] = '1';
    notirix(['sendTags', tags]);
  };

  /** Order placed: leave every scenario and reset every trigger flag. */
  window.notirixPurchase = function () {
    notirix(['sendEvent', 'purchase']);
    var reset = {};
    TRIGGER_FLAGS.forEach(function (flag) { reset[flag] = '0'; });
    notirix(['sendTags', reset]);
  };
})();
</script>

Keep in TRIGGER_FLAGS only the flags of the scenarios you use, and add the flags of new ones there.

“Thank you for your order” page

html
<script>window.notirixPurchase();</script>

Call it once — on the page shown after a successful order. It covers the “no order” condition in every scenario:

  • the purchase event takes the visitor out of a journey if they are already waiting for a push;
  • resetting the flags keeps them from entering a journey later.

For Bitrix: the order confirmation is rendered by the confirm.php template of the sale.order.ajax component — a good place for the call.

Good to know

  • Tags and events are stored only for push subscribers. For others the SDK skips the call and logs a warning to the console. That is fine: there is nowhere to push to anyway.
  • `throttleHours` is an extra safeguard on the site: the trigger is set at most once in N hours, so there are no needless journey entries. The push frequency of a scenario is limited by the journey limit — it counts pushes sent on the server, across devices and browsers too. The total number of pushes is limited by the app frequency cap.
  • Data from site templates must be passed as JSON (in PHP — via json_encode), not pasted into quotes.
  • Trigger code is on each scenario page, in “What the site needs to do”.

Message templates: general rules

Messages → Templates → “New Template”. Each scenario has its own template.

FieldRule
Template NameTrigger · <meaning>, e.g. Trigger · Abandoned checkout
Notification Titleup to ~50 characters, otherwise phones cut it
Notification Body1–2 short sentences
Click URLa variable with a fallback: {{ tag.chk_url | default: "https://example.com/cart/" }}
Image URLoptional
Tagmessage category for the history in the user account, e.g. reminders

Variables like {{ tag.key }} are filled in at send time. | default: "…" sets the value used when the tag is missing. More in Tag variables.

Shared journey settings

These values repeat in every example scenario. Journeys → “New Journey” → “Settings”.

TabSettingValueWhy
GeneralJourney NameTrigger · <meaning>
Entry RulesInclude Segmentsthe Trigger · … segment of this scenario
Exclude Segmentsempty
Future additions onlyOnOld flags left over from tests do not fire pushes at activation
Exit RulesOptionMeet a certain condition
Exit when custom event condition occursOn, event purchaseA purchase ends the journey within 15 seconds
Tag users when they exit earlykey trg_… of this scenario, value 0The flag is reset on an early exit too
Other checkboxesOffSee “What not to do”
Re-entryOptionYes, after a certain amount of timeOtherwise the visitor gets this journey once in a lifetime
Period1 MinutesRe-entry counts journey runs, not pushes — the frequency is limited by the journey limit (below)
ScheduleStart / EndImmediately when activated / Never ends
FrequencyRespect the app frequency capOn
This journey's limitOn: Max pushes 1, Period — the scenario’s throttleHours (given on its page)The main way to say “at most once in N”. See below
When the limit is reachedSkip the pushApplies to both limits. See below

Why the journey limit rather than the re-entry period

Re-entry after N counts journey runs: a run without a push (a purchase during the wait) uses up the period too, and once it ends the visitor enters again on a stale flag. The journey limit counts only the pushes this journey actually sent and does not depend on the app cap. So re-entry is set to 1 minute, and “at most once in N” is the journey limit. throttleHours on the site stays as an extra safeguard against needless tags.

Why “Skip the push” rather than “Defer the push”

“Defer the push” keeps the visitor on the push step and sends the push as soon as the cap frees up. That send does not check the Time Window, so a deferred push may arrive at night. For trigger reminders freshness matters more: when the cap is used up, the reminder is simply dropped.

What not to do

Do notWhat happens
Forget the last step “Tag User: trg_… = 0”The visitor stays in the segment and enters the journey again a minute later. Only the frequency limits stop repeated pushes
Turn on “Exit when a user becomes active in your app/website”The visitor keeps browsing the site — and is thrown out of the journey right after entering it
Turn on “Exit when a user no longer matches the audience conditions”It adds nothing: the final tag and the purchase event already cover the exit
Set “Re-entry: No, they can receive this only once”The visitor gets the reminder once in a lifetime
Use “Last Seen” in the trigger segmentWhile the visitor is on the site the condition is never met. Time is counted by the Wait node
Reset a flag with an empty value or by deleting itIt works, but is not obvious. The convention is always 0