Skip to main content
SDKsWeb

Events, tags, and attributes

event(), tags, custom attributes, and activity tracking for the web SDK.

event(eventName, eventData?)

Sends POST /events. Works before identify using the anonymous visitor id; after identify uses userId.

window.motisig.event('product_viewed', { sku: 'abc-123' });

Journey triggers run only when a identified userId is present.

Tags

await window.motisig.addTags(['beta', 'trial']);
await window.motisig.removeTags(['trial']);

Requires identify first.

Custom attributes

await window.motisig.addOrUpdateAttributes({ plan: 'pro', seats: 5 });
await window.motisig.removeAttributes(['legacy_field']);

Activity tracking

window.motisig.enableActivityTracking({
  appOpens: true,
  flushIntervalMs: 30_000,
});

Batches session/foreground events to POST /activity/batch.