Docs
SDK

Attribution

How the Layers SDK attributes installs to campaigns, plus the platform-specific settings — iOS clipboard attribution and App Tracking Transparency, and Android Install Referrer.

View as Markdown

The SDK attributes installs to the campaigns that drove them automatically — there's no additional wiring beyond initializing it. The platform-specific settings below tune how accurately that attribution resolves.

iOS

App Tracking Transparency

On iOS, request App Tracking Transparency (ATT) permission after onboarding. Starting in Layers SDK 3.3.0, the SDK collects the IDFA automatically when ATT is authorized — you don't handle IDFA yourself. In every other ATT state the IDFA remains absent, while install attribution continues with the install, device, deep-link, and campaign signals that are available. By default, ATT does not change Layers consent; call setConsent separately only when your app has an explicit consent decision. Swift's deprecated attDrivesAdvertisingConsent: true compatibility option is the sole opt-in exception. In Expo, add expo-tracking-transparency and set an attUsageDescription in the plugin config (see Installation → Expo); on native iOS the SDK triggers the prompt through the standard ATT API. In Unity, call LayersSDK.RequestTrackingPermission(...) and set the usage description on the LayersSettings asset, which the post-build processor writes into Info.plist.

Clipboard attribution

Clipboard attribution uses the clipboard to improve iOS install-attribution accuracy. When enabled, users see a brief paste notification when opening a link.

It's off by default and configured per app, not in code: open your project's Connections screen in the Layers app, select Layers SDK, and use the Clipboard attribution setting under Attribution. It's available for iOS apps only.

Android

Android uses Install Referrer for attribution — it's built into the SDK and needs no configuration or per-app setting. Clipboard attribution does not apply on Android.

Ad click parameters

Layers tracking links accept four optional query parameters that name the ad object a click came from:

ParameterWhat it holds
campaignthe campaign id
adsetthe ad set / ad group id
adthe ad id
creativethe creative id

They ride any Layers tracking link — https://in.layers.com/c/<app_id> or https://in.layers.com/l/<link_id>. campaign, adset and ad reach the install as campaign_id, adset_id and ad_id, so a report can attribute revenue to the exact ad that produced it. Campaigns Layers builds for you set those three automatically; add them yourself on links you build.

creative is recorded on the click and does not reach the install today, and no ad platform publishes a macro for it — set it only if you want it on the click record.

Each value is stored when it is at most 64 characters of A-Z a-z 0-9 _ . : @ ~ + -, which every ad platform's ids fit. A longer or differently-shaped value is recorded as no id rather than stored, because this endpoint takes no authentication.

Do not type an id into the URL. Every ad platform has a macro it substitutes at click time, which keeps the id correct if the ad is later duplicated or renamed. Paste the string for your platform:

Meta — Ads Manager → your ad → TrackingURL parameters (or url_tags on the ad creative through the Marketing API). Meta applies it to every link in the ad, so leave it off the destination URL itself. If your destination already sets one of these parameters, drop that one here — Meta may replace the value your URL carries:

campaign={{campaign.id}}&adset={{adset.id}}&ad={{ad.id}}

TikTok — append to the ad's Destination URL (landing_page_url). __AID__ is the ad group and __CID__ is the ad:

campaign=__CAMPAIGN_ID__&adset=__AID__&ad=__CID__

Google Ads — set as the Final URL suffix on the campaign (Settings → Campaign URL options). Google appends it to the landing page, so no leading ?:

campaign={campaignid}&adset={adgroupid}&ad={creative}

A macro that arrives unsubstituted — a literal {{ad.id}}, __CID__ or {creative} — is never stored as an id. The click is recorded with the column left empty, so a broken template shows up as missing attribution rather than as a campaign with a strange name.

Apple Search Ads has no click macros on the URL. App Store installs attribute through an AdServices token the device fetches, so there is nothing to add to the link.

See also

On this page