コンテンツにスキップ

__CAPGO_KEEP_11__

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

Initializes the RudderStack client.

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

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

コピー

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

イベント名をトラッキングする

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

コピー

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

Sends a screen call for the provided screen name.

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

Section titled “alias”

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

Section titled “reset”

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

Section titled “flush”

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);

RudderStackのネイティブSDKのサポートされている構成キー

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が変更された場合に、再度同期を実行してください。

「はじめから始める」の続き

「はじめから始める」のセクション

Capacitorを使用している場合 はじめから始める ダッシュボードとAPIの運用計画を立てるには、 @capgo/capacitor-rudderstackを使用します。 @capgo/capacitor-rudderstackを使用したnative機能の概要 APIの概要 APIの概要の実装詳細 導入 導入の実装詳細 APIのキー APIのキーに関する実装詳細 デバイス デバイスの実装詳細