コンテンツにジャンプ

はじめに

ターミナル画面
bun add @capgo/capacitor-rudderstack
bunx cap sync
import { nativePlugin } from '@capgo/capacitor-rudderstack';

RudderStackクライアントを初期化します。

メソッドはCordovaの署名を保持しているので、2番目の引数はconfigオブジェクトかRudderオプションオブジェクトのいずれかになります。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.initialize('value');

指定されたユーザIDのためにidentifyコールを送信します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.identify('value');

指定されたグループIDのためにgroupコールを送信します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.group('value');

指定されたイベント名のためにtrackコールを送信します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.track('value');

__CAPGO_KEEP_0__の画面名を指定して画面呼び出しを送信します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.screen('value');

__CAPGO_KEEP_0__の新しい識別子に現在のユーザーをエイリアスします。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.alias('value');

__CAPGO_KEEP_0__の現在のルーダースタックIDをリセットします。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.reset();

__CAPGO_KEEP_0__のキューされたイベントを即座にフラッシュします。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.flush();

RudderStackがサポートする目的地に送信するデバイストークンを設定します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putDeviceToken('value');

現在の契約のソース定義を参照してください。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAdvertisingId('value');

カスタム広告ID値を設定します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAdvertisingId('value');

現在の契約のソース定義を参照してください。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.setAnonymousId('value');

カスタムの匿名ID値を設定します。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.putAnonymousId('value');

RudderStackのトラッキングオプトアウトを切り替えます。

import { nativePlugin } from '@capgo/capacitor-rudderstack';
await nativePlugin.optOut(true);

サポートされているルーダー設定のキーのリストです。

export interface RudderConfiguration {
/**
* RudderStack data plane URL.
*/
dataPlaneUrl?: string;
/**
* Number of events to batch before a flush.
*/
flushQueueSize?: number;
/**
* Database row threshold that triggers pruning on Android and iOS.
*/
dbCountThreshold?: number;
/**
* Server config refresh interval in hours.
*/
configRefreshInterval?: number;
/**
* RudderStack log verbosity.
*/
logLevel?: RudderLogLevelValue;
/**
* Sleep timeout / sleep count used by the native SDK.
*/
sleepTimeOut?: number;
/**
* Android only. Lets the native SDK collect the advertising identifier automatically.
*/
autoCollectAdvertId?: boolean;
/**
* Tracks `Application Installed`, `Application Updated`, and `Application Opened` automatically.
*/
trackLifecycleEvents?: boolean;
/**
* RudderStack control plane URL.
*/
controlPlaneUrl?: string;
/**
* Enables automatic screen tracking where supported by the native SDK.
*/
recordScreenViews?: boolean;
/**
* Ignored in this Capacitor port.
*
* The Cordova SDK uses this field to bootstrap native destination factories from companion plugins.
* Those extension packages are not implemented in this first Capacitor release.
*/
factories?: any[];
}

RudderStack 1回あたりのオプション。

export interface RudderOptions {
/**
* External identifiers forwarded with the event.
*/
externalIds?: Record<string, string>;
/**
* Destination enablement flags keyed by integration name.
*/
integrations?: Record<string, boolean>;
}

受け入れる RudderTraits のペイロード identifygroup.

export type RudderTraits = Record<string, any>;

受け入れる RudderProperties のペイロード trackscreen.

export type RudderProperties = Record<string, any>;

受け入れるプラグインバージョンのペイロード

export interface PluginVersionResult {
/**
* Version identifier returned by the platform implementation.
*/
version: string;
}

RudderStack ログレベル値が提供されます。これは、移行のための便宜上の機能です。

export type RudderLogLevelValue = 0 | 1 | 2 | 3 | 4 | 5;

このページはプラグインの src/definitions.tsパブリック API がアップストリームで変更された場合に再度同期を実行してください。