Skip to main content
Tappd banners are placement-based content units you create in the dashboard and fetch in your React Native app using a placement identifier — typically a screen name or component ID. Unlike in-app messages, which are trigger-driven and shown once, banners are designed for persistent placements and support advanced delivery controls like audience targeting, scheduling windows, frequency capping, and multi-variant A/B testing.

Quick Start

Identify your user, fetch banners for a placement, and render each result with your own component:

Placement System

Banners attach to your UI via a placement identifier — a string you define in the dashboard and pass to getBanners(). Use whatever naming convention makes sense for your app:
Use screen names as placement identifiers whenever possible. Mapping banners to screens keeps your placements predictable and makes it easy to reload banners when a user navigates to a new screen.

Fetching Banners

getBanners() automatically caches results for 5 minutes to reduce API calls. Use the optional second argument to control caching and rendering behaviour:
Each item in the response array contains a banner object and the winning variant object selected for the current user:

Rendering Banners in React Native

Build a reusable Banner component that reads from the banner and variant objects returned by the API:

Manual Event Tracking

Call the banners tracking methods explicitly when you need fine-grained control over when events are recorded:
1

Track display

Call banners.display() when the banner becomes visible. Store the returned displayId — you need it for click and dismiss tracking.
2

Track clicks

Call banners.click() when the user taps the CTA button.
3

Track dismissals

Call banners.dismiss() when the user closes the banner.
Use the position value from variant.design to apply the correct layout style:

Features

Audience Targeting

Show banners only to specific customer segments or users matching custom attribute rules. Banners with targeting enabled are only returned when the identified user meets the criteria.

Scheduling

Set start and end dates, restrict banners to specific hours of the day or days of the week, and define a timezone for accurate schedule calculations.

Frequency Capping

Limit how many times a banner is shown to an individual user. Configure a maximum display count and a reset period — session, hour, day, week, or month.

A/B Testing

Run experiments with multiple variants. Set traffic allocation percentages for each variant and let the SDK automatically assign users based on their customer ID.

Analytics

Every banner interaction is tracked automatically when you call the banners.* methods:

API Reference

Promise<Banner[]>
Fetch eligible banners for a placement.
  • selector (string, required) — Placement identifier (screen name, component name, etc.)
  • options.autoRender (boolean, default false) — Automatically render eligible banners after fetching, without a separate banners.display() call.
  • options.forceRefresh (boolean, default false) — Bypass the 5-minute cache and fetch fresh data.
Promise<string>
Track a banner display. Returns a displayId string you must store and pass to banners.click() and banners.dismiss().
Promise<void>
Track a banner CTA click. Pass the displayId returned by banners.display().
Promise<void>
Track a banner dismissal. Pass the displayId returned by banners.display().

Best Practices

Keep these tips in mind for reliable banner delivery and accurate analytics:
  • Identify users early — Call identify() before fetching banners so targeting rules can be evaluated.
  • Reload on navigation — Fetch banners again whenever the user navigates to a new screen so placement-specific content stays fresh.
  • Always track all three events — Display, click, and dismiss events together give you accurate CTR and frequency capping data.
  • Lean on caching — The SDK’s 5-minute cache reduces API overhead. Use forceRefresh only when you know the content has changed.
  • Handle errors gracefully — Wrap getBanners() calls in try-catch blocks so a failed fetch doesn’t break your screen.

Troubleshooting

If getBanners() returns an empty array or banners don’t appear in your UI:
  1. Make sure identify() was called before getBanners().
  2. Confirm the placement identifier exactly matches what’s configured in the dashboard.
  3. Check the browser console or device logs for network errors.
  4. Verify the banner is published and active in the Tappd dashboard.
  5. Review targeting conditions — the identified user must match any configured segment or rule.
  6. Check that the banner’s schedule window is currently active.
  7. Confirm frequency capping hasn’t been reached for this user.
If banners appear but look wrong:
  1. Verify you’re reading style values from variant.design and applying them correctly to your component.
  2. Check that the container has explicit dimensions — React Native won’t size a component with no content or constraints.
  3. Look for style conflicts between your app’s global styles and the banner component.
  4. Ensure positionStyles are applied for absolute-positioned banners (top/bottom).
If clicks and dismissals aren’t appearing in Tappd analytics:
  1. Confirm apiUrl in your SDK config points to https://sdk.gotappd.com/api/v1/sdk.
  2. Make sure you’re storing the displayId returned by banners.display() and passing it to banners.click() and banners.dismiss().
  3. Check device logs for network errors on the tracking API calls.
  4. Verify your appId is correct.