Skip to content

Marketing campaigns built-in

The marketing-campaigns built-in registers structured prompts from account or host configuration.

Configure one campaign

js
{
  id: 'marketing-campaigns',
  enabled: true,
  options: {
    campaign: {
      id: 'package-offer',
      trigger: 'wheel:viewed',
      priority: 20,
      frequency: {
        oncePerSession: true,
      },
      creative: {
        layout: 'compact',
        eyebrow: 'Package offer',
        title: 'Complete the look',
        body: 'Ask about a mounted wheel and tire package.',
        actions: [
          {
            label: 'Shop by vehicle',
            command: 'openSearchByVehicle',
          },
          {
            label: 'Keep browsing',
            command: 'dismiss',
            variant: 'secondary',
          },
        ],
      },
    },
  },
}

Use options.campaign for one definition or options.campaigns for an array. Both can be present; all supplied definitions are registered.

Defaults

FieldDefault
enabledtrue
placementmodal
triggerapp:mounted
priority0
delayMsNo delay

When several eligible campaigns share a trigger, higher priority wins. Registration time breaks a priority tie.

Conditions and frequency

Use conditions.routes, conditions.excludeRoutes, or conditions.pathIncludes to narrow where a campaign appears. Use frequency.oncePerSession, frequency.maxPerSession, and frequency.cooldownHours to control repetition.

Cooldown tracking uses browser storage when available. A browser that blocks storage can still display the campaign.

Creative and actions

Creative supports hero, split, and compact layouts; optional eyebrow, body, badge, image, and accent color; and one or more actions. Actions can run supported configurator commands, open an external link, emit an event, or dismiss the campaign.

See the Campaigns API reference for the complete schema, triggers, event payloads, and action fields.

Icon Visualizer developer documentation