Skip to main content

Entry source

Entry source tells you where each game entry came from: an Explore result, a notification, a referral, a Jest Ads campaign, or another entry point. Use it in your analytics to compare entries, tutorial completion, retention, and purchases by source, then improve your game experience or campaigns based on the results.

The examples after the first section use the HTML5 SDK.

Read the entry source​

Read the entry source after SDK initialization completes. The result is synchronous and stays the same for that game entry.

JestSDK.getEntrySource()

await JestSDK.init();

const source = JestSDK.getEntrySource();

The exported EntrySource type is a discriminated union. Check source.type before reading the fields for that source.

Entry source and entry payload​

Entry source and entry payload provide complementary information:

MethodDataPurpose
getEntrySource()Attribution supplied by Jest, such as an entry surface or campaign ID.Track where game entries come from so you can analyze and optimize them.
getEntryPayload()Custom data you attach to a link or campaign, such as a game mode or onboarding choice.Pass context into the game and decide what to show or do on arrival.

For example, a Jest Ads entry source identifies the campaign that brought the player in. That campaign's custom entry payload can tell your game to start the boss-rush mode featured in the ad. Read both to measure the campaign and deliver the game experience you advertised.

Analyze entries by source​

Record the source with your game-entry event in your own analytics. In these examples, analytics.track represents your analytics client's event method.

await JestSDK.init();

const source = JestSDK.getEntrySource();
analytics.track("game_entry", {
entry_source: source.type,
entry_details: source,
});

Carry the source into later events, such as tutorial completion or a purchase, to compare outcomes. For example, compare tutorial completion for players arriving from Explore with players arriving from Jest Ads. If an ad brings entries but few players finish the tutorial, test a starting experience that gets them to the gameplay shown in the ad sooner.

Measure a Jest Ads campaign​

Entries from Jest Ads use type: "jest_ad" and include the campaign's ID and name. You can group entries and later conversion events by campaign ID without adding a campaign tag to your custom payload.

campaign.id is the same ID used in Ads Manager's campaign edit and reporting URLs. Use it as a stable analytics key. campaign.name is the readable name you set in Ads Manager and can change when you rename the campaign.

await JestSDK.init();

const source = JestSDK.getEntrySource();
const payload = JestSDK.getEntryPayload();

if (source.type === "jest_ad") {
analytics.track("jest_ad_entry", {
campaign_id: source.campaign.id,
campaign_name: source.campaign.name,
});
}

if (payload.mode === "boss_rush") {
startBossRush();
}

Attach the same campaign ID to later tutorial-completion and purchase events. Compare those results across campaigns to decide which creatives to keep running or which starting experience to improve. Use the custom payload for game-specific instructions such as mode; use the entry source's campaign fields for campaign attribution.

Measure external ad campaigns​

For external ad links with UTM parameters, type: "external_ad" includes the decoded UTM values. Missing values are null.

const source = JestSDK.getEntrySource();

if (source.type === "external_ad") {
analytics.track("external_ad_entry", {
utm_source: source.utm.source,
utm_medium: source.utm.medium,
utm_campaign: source.utm.campaign,
utm_term: source.utm.term,
utm_content: source.utm.content,
});
}

Use these values to compare the entries and subsequent conversions from different ad networks, campaigns, or creatives.

Game and platform notifications​

For notification-link entries, origin identifies who initiated the notification:

  • game: A game scheduled it through the SDK. identifier is the value this game supplied to scheduleNotification, or null when unavailable. For example, a "your crops are ready" notification could carry identifier: "harvest_ready".
  • platform: An automated reminder from Jest asking the user to play. Jest schedules these reminders for registered players to return to games they have played. identifier is always null.

Only opening a notification's link is a notification entry. Opening the game from the Home tab's Activity section is a home entry with section: "activity".

Source reference​

typeFieldsEntry point
explorevia: "feed" | "search"Explore feed or search result.
homesection: "recents" | "recommended" | "activity" | "all_games"A section of the Home tab.
profilewhose: "own" | "other"The player's profile or another player's profile.
chatvia: "flair" | "link" | "screenshot" | "room_header"A chat flair, game link, screenshot, or room's Play button.
notificationorigin: "game" | "platform", identifier: string | nullA notification link.
jest_adcampaign: { id: string; name: string }A promoted Explore card with verified campaign attribution.
external_adutm: { source; medium; campaign; term; content }An external ad link. Each UTM field is a decoded string or null when absent.
referralorigin: "game" | "platform"An app referral link or a platform invite.
directNo extra fields.An organic visit, PWA launch, login or registration link, or standalone mock mode.
unknownNo extra fields.An unclassified entry, including cross-game redirects and onboarding handoffs.

The result describes the current entry.