代理須知
Tap App Link + Qonversion
您是一名編碼助理,幫助開發人員將 Tap App Link(創作者儀表板、追蹤安裝連結和應用程式折扣代碼)與 Qonversion 整合。 Tap App Link 透過 SDK 匹配安裝客戶端,並透過 Qonversion Webhook 在伺服器端分配購買收入。 當觀看者在結帳時輸入代碼時,促銷代碼是第二個歸因路徑。
1.安裝並配置Tap App Link SDK
如果專案缺少 SDK,請為目標平台新增它,然後在啟動時呼叫一次配置。 在測試建置中使用沙箱密鑰和環境,在商店建置中使用生產環境。
- React Native / Expo (development client; Expo Go cannot load Play Install Referrer): install @Tap App Link/react-native@^0.3.3 and the optional peer @react-native-async-storage/async-storage (yarn add, npm install, or npx expo install). Without AsyncStorage, each cold launch posts again.
- iOS: Swift Package https://github.com/tapapplink/tapapplink-ios from "0.3.3"
- Android: implementation("com.github.Tap App Link:Tap App Link-android:0.3.3")
- Flutter: Tap App Link: ^0.3.3
在每個平台上使用 SDK 0.3.3 或更高版本。
yarn add @tapapplink/react-native@^0.3.3 @react-native-async-storage/async-storage
# or: npm install @tapapplink/react-native@^0.3.3 @react-native-async-storage/async-storage
# or: npx expo install @tapapplink/react-native@^0.3.3 @react-native-async-storage/async-storageimport { TapAppLink } from "@tapapplink/react-native";
import Purchases from "react-native-purchases";
TapAppLink.configure({
publicKey: "YOUR_TAPAPPLINK_KEY",
environment: __DEV__ ? "sandbox" : "production",
});
await TapAppLink.trackInstall();
await TapAppLink.setAppUserId(await Purchases.getAppUserID());
const offer = TapAppLink.getOffer();
if (offer?.billingOfferId) {
const offerings = await Purchases.getOfferings();
const discounted = offerings.all[offer.billingOfferId];
// Present this offering on the paywall
}2. 追蹤安裝,然後橋接 Qonversion 用戶 ID
trackInstall()每次從 SDK 0.3.0 或更高版本啟動時都可以安全地呼叫(React Native 也需要@react-native-async-storage/async-storage安裝)。 之後立即致電setAppUserId()使用 webhook 上的 id。 該橋將 Webhook 事件附加到驅動安裝的創作者。
Qonversion.identify(userId) / custom_user_id
- 使用您控制的穩定用戶 ID 呼叫 Qonversion.identify。 這將成為 webhooks 上的 custom_user_id。
- 將相同的字串傳遞給 setAppUserId。 如果跳過識別,custom_user_id 為空,並且匹配回退到 Qonversion 自己的 user_id。
- 在 trackInstall 之後、首次購買之前立即調用 setAppUserId。
await TapAppLink.trackInstall();
await Qonversion.getSharedInstance().identify(myUserId);
await TapAppLink.setAppUserId(myUserId);3. 電匯折扣碼
一場比賽結束後,getOffer()返回創作者的折扣。 如果使用者在應用程式中輸入代碼,請調用applyCode()所以他們仍然歸因於那個創造者。
await TapAppLink.applyCode("SARAH10");
const offer = TapAppLink.getOffer();將discount.billingOfferId對應到Qonversion產品ID,並在符合或代碼兌換後顯示該產品。
完整產品指南: https://tapapplink.com/docs/concepts/promo-codes/
4. 配置 Qonversion webhook
人類點擊路徑: https://tapapplink.com/docs/integrations/qonversion/。 請依照這些儀表板步驟操作。 概括:
- 開啟集成,然後開啟 Qonversion 儀表板中的 Webhooks。
- Qonversion 使用一種帶有主 URL、Sandbox Webhook URL 和單一標頭授權令牌的表單。
- 對於沙箱:將 Tap App Link 沙箱 Webhook URL 貼到 Sandbox Webhook URL 中,並將沙箱簽章金鑰貼到標頭授權令牌(原始金鑰,無承載)中。 Qonversion 前缀为 Basic。 保存并验证沙盒购买。
- 空的 Sandbox Webhook URL 意味著沙箱事件無法傳遞。
- 當您上線時:將 Tap App Link 生產 Webhook URL 貼上到主 URL 欄位中,並將生產簽章金鑰貼到 Header Authorization-Token 中。 再次儲存。 Qonversion的單一令牌表示您可以在切換環境時切換令牌。
- 啟用下面清單中的事件類型。 保留 Qonversion 的預設事件名稱。
- 節省。 Qonversion 向 URL 發送請求,並在收到 2xx 時啟動整合。
將簽章金鑰貼到標頭授權令牌中。 使用原始秘密,無需持有者。 Qonversion 將其作為授權:基本 {token} 發送,並使用貼上時的令牌。
啟用事件: 訂閱開始, 應用程式內購買, 試用_轉換, 訂閱更新, 訂閱_取消 / 訂閱_取消 / 試用_取消, 訂閱_過期/試用_過期, 訂閱退款 / 應用程式內退款, 訂閱升級/訂閱產品更改, 訂閱計費重試 / 試用計費重試。 額外的事件將被忽略。 Sandbox Qonversion 事件必須命中 Tap App Link 沙箱環境 URL。 Production 事件必須投入生產。 將它們混合在一起可以在您的即時佣金報表中進行測試購買。
5. 驗證
- 在Tap App Link中,切換到Sandbox並開啟Live Attribution Debugger。
- In Tap App Link, switch to Sandbox and open the Live Attribution Debugger.
- 確認時間表達到安裝匹配和計費客戶連結。 如果重試,請先在偵錯版本中呼叫resetForTesting()。
- 觸發沙箱購買並確認 webhook 返回 2xx。
- (可選)啟動促銷代碼觀察並使用 applyCode() 兌換創作者代碼。
硬約束
- 請勿修改帳單驗證、收據驗證或購買流程。 Tap App Link 僅限歸屬。
- 將 Production 和 Sandbox 金鑰保留在相符的版本上。 切勿將沙盒密鑰運送到商店。
- 在更改 SDK 初始化、使用者 ID 橋接、優惠演示和代碼兌換之外的代碼之前,請詢問開發人員。
- 更喜歡 https://tapapplink.com/docs/ 上的公共文檔,而不是猜測 API 形狀。
人類快速啟動: https://tapapplink.com/docs/quick-start/. 問題: support@tapapplink.com.