Skip to main content
プラグインに戻る
@capgo/capacitor-install-referrer
チュートリアル
github.com/Cap-go による

インストール リファラー

Capacitor から Google Play のインストール リファラー データと Apple AdServices 属性を読み取ります

ガイド

__CAPGO_KEEP_0__のインストールリファラーに関するチュートリアル

capgo/capacitor-install-referrerを使用すると、capgoアプリからインストール Attribution シグナルを読み取ることができます。

@capgo/capacitor-install-referrer Capacitorを使用すると、AndroidでGoogle PlayインストールリファラーのデータとiOSでApple AdServices Attributionトークンを1つのCapacitorで取得できます。

Use it when you need Google Play Install Referrer data on Android and Apple AdServices attribution tokens on iOS through one API.

このプラグインが提供するもの

bun add @capgo/capacitor-install-referrer
bunx cap sync

__CAPGO_KEEP_0__のインストール Attribution 詳細を返します。

  • getReferrer __CAPGO_KEEP_1__は、__CAPGO_KEEP_2__から__CAPGO_KEEP_0__への移行のための非推奨の互換性のエイリアスです。
  • GetReferrer Androidでは、Playリファラー文字列、クリックタイムスタンプ、インストールタイムスタンプ、およびインスタントアプリフラグを返します。 cap-play-install-referrer.
  • __CAPGO_KEEP_0__は「Google Play」
  • iOSはAdServicesのAttribution Tokenを返し、AppleのAttribution Payloadをオプションで取得する。

使用例

import { InstallReferrer } from '@capgo/capacitor-install-referrer';

const result = await InstallReferrer.getReferrer();

if (result.platform === 'android') {
  console.log(result.referrer);
}

if (result.platform === 'ios') {
  console.log(result.attributionToken);
}

Apple Attribution Payload

const result = await InstallReferrer.getReferrer({
  fetchAppleAttribution: true,
  appleAttributionRetryCount: 3,
  appleAttributionRetryDelayMs: 5000,
});

console.log(result.appleAttribution);

プラットフォームに関する注意

AndroidはGoogle Play Install Referrerサービスを使用し、実際のリファラー データのためにPlay Storeのインストールが必要です。iOSはApple AdServicesを使用する必要があります。AppleはApp Storeのインストールの一般的なリファラーの代替品を提供していないためです。

フル リファレンス