リモートコマンド:FullStory
AndroidおよびSwift/iOS用FullStoryのTealiumリモートコマンド統合
必要条件
- 以下のいずれかのモバイルライブラリ:
- Tealium for Android-Kotlin (1.0.0+)
- Tealium for Android-Java (FullStory 1.0.0+の場合は5.9.0+、それ以前のバージョンの場合は<5.9.0)
- Tealium for iOS-Swift (2.18.0+)
- 以下のいずれかのリモートコマンド統合:
- FullStory Remote Command JSON File (Android-Kotlin 1.0.0+またはiOS-Swift 2.18.0+が必要)
- Tealium iQタグ管理内のFullStory Remote Command tag
動作原理
FullStory統合は3つのコンポーネントを使用します:
- FullStoryネイティブSDK。
- FullStoryメソッドをラップするリモートコマンドモジュール。
- イベントトラッキングをネイティブFullStoryコールに変換するJSON構成ファイルまたはRemote Commandタグ。
アプリにFullStoryリモートコマンドモジュールを追加すると、必要なFullStoryライブラリが自動的にインストールされビルドされます。依存関係マネージャーのインストールを使用している場合、FullStory SDKを別途インストールする必要はありません。
依存関係マネージャーとしてCocoaPodsまたはCarthageを使用している場合は、ビルドスクリプトとして追加できるようにFullStoryコマンドラインツールを手動でダウンロードする必要があります。
リモートコマンドのオプションは2つあります:
- JSON構成ファイルを使用する(推奨)、リモートまたはアプリ内にローカルでホストされます。
- iQタグ管理を使用してマッピングを構成し、ベンダー統合のRemote Commandタグを追加します。
詳細については、ベンダー統合を参照してください。
インストール
依存関係マネージャー
モジュールのインストールには、以下の依存関係マネージャーのいずれかを使用することをお勧めします:
- Xcodeプロジェクトで、File > Add Packages… > Add Package Dependencyを選択します。
- 次のリポジトリURLを入力します:
https://github.com/tealium/tealium-ios-fullstory-remote-command。 - バージョンルールを構成します。
Up to next major構成を推奨します。現在のTealiumFullstoryバージョンがリストに表示されない場合は、Swiftパッケージキャッシュをリセットしてください。 - インストールする
TealiumFullstoryモジュールを選択し、モジュールをインストールするアプリターゲットを選択します。
プロジェクトに複数のアプリターゲットがあり、TealiumFullstoryモジュールを複数のアプリターゲットに追加する必要がある場合は、Frameworks, Libraries, and Embedded Contentセクションで手動で追加する必要があります。
追加のアプリターゲットにTealiumFullstoryをインストールするには:
- Project NavigatorでXcodeプロジェクトを選択します。
- Xcodeプロジェクトで、TARGETSセクションのアプリターゲットを選択します。
- General > Frameworks, Libraries & Embedded Contentに移動し、
TealiumFullstoryモジュールをアプリターゲットに追加します。
Tealium Swiftライブラリから追加のモジュールを追加するには、Swift Package Managerの指示に従ってください。
iOS用のFullStoryリモートコマンドをCocoaPodsを使用してインストールするには:
- Podfileにすでに存在する場合は
tealium-swiftを削除します。tealium-swiftの依存関係は、すでにTealiumFullstoryフレームワークに含まれています。 - Podfileに次の依存関係を追加します:
pod "TealiumFullstory"TealiumFullstoryポッドには、次のTealiumSwift依存関係が含まれています:'tealium-swift/Core' 'tealium-swift/RemoteCommands' 'tealium-swift/TagManagement' TealiumHelperファイルおよびTealiumクラスまたはFullStory Remote Commandにアクセスする他のファイルにTealiumSwiftおよびTealiumFullstoryモジュールをインポートします。
iOS用のFullStoryリモートコマンドをCarthageを使用してインストールするには:
- Cartfileから
tealium-swiftを削除します。tealium-swiftの依存関係は、すでにTealiumFullstoryフレームワークに含まれています。 - Cartfileに次の依存関係を追加します:
github "tealium/tealium-ios-fullstory-remote-command"
Android用のFullStoryリモートコマンドをMavenを使用してインストールするには:
- まだ行っていない場合は、Tealium for Android (Kotlin)またはTealium for Android (Java)をインストールし、プロジェクトのトップレベルの
build.gradleファイルにTealium Maven URLを追加します。allprojects { repositories { mavenCentral() maven { url "https://maven.tealiumiq.com/android/releases/" } maven { url "https://maven.fullstory.com" } } } - アプリプロジェクトの
build.gradleファイルに次の依存関係を追加することで、FullStory SDKとTealium-FullStoryリモートコマンドの両方をインポートします:dependencies { implementation 'com.tealium.remotecommands:fullstory:1.1.0' } - App/Moduleの
build.gradleにFullStory gradleプラグインを追加します。<PLUGIN PROPERTIES>を利用可能なプロパティで置き換えます:fullstory { <PLUGIN PROPERTIES> }
マニュアルインストール(iOS)
iOS用のFullStoryリモートコマンドのマニュアルインストールには、Tealium for Swiftライブラリがインストールされている必要があります。iOSプロジェクト用のFullStoryリモートコマンドをインストールするには:
- まだ行っていない場合は、FullStory SDKをインストールします。
- Tealium iOS FullStoryリモートコマンドリポジトリをクローンし、
Sourcesフォルダ内のファイルをプロジェクトにドラッグします。 Dispatchers.RemoteCommandsをディスパッチャーとして追加します。remoteAPIEnabled構成フラグをtrueに構成します。
初期化
すべてのTealiumライブラリについて、初期化時にFullStoryリモートコマンドを登録します。
Android (Kotlin)
TealiumのAndroid (Kotlin)ライブラリ用に、JSON構成ファイルまたはRemote Commandタグを使用してリモートコマンドを初期化します。
次のコードは、ローカルファイルオプションを使用するJSON Remote Commands機能用に設計されています:
val config = TealiumConfig(application,
"ACCOUNT",
"PROFILE",
Environment.DEV,
dispatchers = mutableSetOf(Dispatchers.RemoteCommands));
var tealium = Tealium.create(TEALIUM_MAIN, config) {
// FullStory Remote Commandを初期化
val fullstoryCommand = FullStoryRemoteCommand()
// コマンドを登録
remoteCommands?.add(fullstoryCommand, filename = "tealium-fullstory.json")
}
次のコードは、Remote Commandタグ機能を使用するために設計されています:
val config = TealiumConfig(application,
"ACCOUNT",
"PROFILE",
Environment.DEV,
dispatchers = mutableSetOf(Dispatchers.RemoteCommands));
var tealium = Tealium.create(TEALIUM_MAIN, config) {
// FullStory Remote Commandを初期化
val fullstoryCommand = FullStoryRemoteCommand()
// コマンドを登録
remoteCommands?.add(fullstoryCommand)
}
Android (Java)
Android用のJSON Remote Commandファイル機能は、Kotlin SDKでのみ利用可能です。
以下のコードは、Remote Commandタグ機能で使用するために設計されています:
Tealium.Config config = Tealium.Config.create(application, "ACCOUNT", "PROFILE", "ENVIRONMENT");
Tealium teal = Tealium.createInstance(TEALIUM_MAIN, config);
FullStoryRemoteCommand fullstory = new FullStoryRemoteCommand();
// コマンドを登録
teal.addRemoteCommand(fullstory);
iOS (Swift)
TealiumのiOS (Swift)ライブラリでJSON構成ファイルまたはRemote Commandタグを使用してリモートコマンドを初期化します。
以下のコードは、JSON Remote Commands機能で使用するために設計されており、ローカルファイルオプションを使用します:
var tealium : Tealium?
let config = TealiumConfig(account: "ACCOUNT",
profile: "PROFILE",
environment: "ENVIRONMENT",
dataSource: "DATASOURCE",
options: nil)
config.dispatchers = [Dispatchers.TagManagement,
Dispatchers.RemoteCommands]
config.remoteAPIEnabled = true // Remote Commandsを使用するために必要
tealium = Tealium(config: config) { _ in
guard let remoteCommands = self.tealium?.remoteCommands else {
return
}
let fullstory = FullstoryRemoteCommand(type: .local(file: "fullstory"))
remoteCommands.add(fullstory)
}
以下のコードは、Remote Commandタグ機能で使用するために設計されています:
var tealium : Tealium?
let config = TealiumConfig(account: "ACCOUNT",
profile: "PROFILE",
environment: "ENVIRONMENT",
dataSource: "DATASOURCE",
options: nil)
config.dispatchers = [Dispatchers.TagManagement,
Dispatchers.RemoteCommands]
config.remoteAPIEnabled = true // Remote Commandsを使用するために必要
tealium = Tealium(config: config) { _ in
guard let remoteCommands = self.tealium?.remoteCommands else {
return
}
let fullstory = FullstoryRemoteCommand()
remoteCommands.add(fullstory)
}
JSONテンプレート
JSON構成ファイルを使用してリモートコマンドを構成する場合は、以下のテンプレートを参照してください。このテンプレートには、標準的なeコマースインストールで使用される一般的なマッピングが含まれています。必要に応じてマッピングを編集してください。
{
"config": {},
"mappings": {
"tealium_event": "event_name",
"uid": "uid_str",
"email": "user_variables.email_str",
"phone": "user_variables.phone_str",
"cart_id": "event.cart_id_str",
"product_id": "event.product_id_str",
"price": "event.price_real",
"name": "event.name_str",
"category": "event.categoryProperties"
},
"commands": {
"launch": "logevent",
"identify_user": "identify",
"tealiumSampleEvent": "logevent",
"tealiumSampleEventWithData": "logevent"
}
}
サポートされているメソッド
各FullStoryメソッドにコマンドをマッピングします。特定の形式で対応するコマンドを渡すことで、FullStoryメソッドをトリガーできます。
| Remote Command | FullStory Method |
|---|---|
logevent |
FS.event() |
identify |
FS.identify() |
setuservariables |
FS.setUserVars() |
shutdown |
FS.shutdown() |
restart |
FS.restart() |
consent |
FS.consent() |
anonymize |
FS.anonymize() |
resetidletimer |
FS.resetIdleTimer() |
log |
FS.log() |
FullStory SDKはTealium SDKと一緒にインストールされているため、Tealium FullStory Remote Commandタグによって提供されていない機能であっても、SDKを直接呼び出すことで任意のネイティブFullStory機能をトリガーできます。
SDKセットアップ
初期化
FullStory SDKは起動時に自動的に初期化されます。
FullStory開発者ガイド:初期SDKセットアップ
ログイベント
| Remote Command | FullStory Method |
|---|---|
logevent |
FS.event() |
| パラメータ | タイプ |
|---|---|
event_name (必須) |
文字列 |
event |
マップ |
FullStory開発者ガイド:ログイベント
識別
| Remote Command | FullStory Method |
|---|---|
identify |
FS.identify() |
| パラメータ | タイプ |
|---|---|
uid (必須) |
文字列 |
user_variables |
マップ |
FullStory開発者ガイド:識別
ユーザー変数の構成
| Remote Command | FullStory Method |
|---|---|
setuservariables |
FS.setUserVars() |
| パラメータ | タイプ |
|---|---|
user_variables (必須) |
マップ |
user_variablesパラメータは、キーがstringsで値がデータタイプ(例:_str, _int, _bool)で接尾辞が付けられたキー値ペアのオブジェクトを取ります。詳細については、カスタムAPIプロパティの構成を参照してください。
FullStory開発者ガイド:ユーザー変数の構成
シャットダウン
| Remote Command | FullStory Method |
|---|---|
shutdown |
FS.shutdown() |
FullStoryの記録を停止します。記録を再開するにはrestartを使用します。
FullStory開発者ガイド:シャットダウン
リスタート
| Remote Command | FullStory Method |
|---|---|
restart |
FS.restart() |
shutdownで停止した後、FullStoryの記録を再開します。
FullStory開発者ガイド:リスタート
同意
| Remote Command | FullStory Method |
|---|---|
consent |
FS.consent() |
| パラメータ | タイプ |
|---|---|
consent_granted (必須) |
ブール値 |
FullStoryセッション記録のためのユーザー同意を付与または取り消します。
FullStory開発者ガイド:同意
匿名化
| Remote Command | FullStory Method |
|---|---|
anonymize |
FS.anonymize() |
現在のユーザーセッションを匿名化し、以前に構成されたユーザー識別を削除します。
FullStory開発者ガイド:匿名化
アイドルタイマーのリセット
| Remote Command | FullStory Method |
|---|---|
resetidletimer |
FS.resetIdleTimer() |
FullStoryのアイドルタイムアウトタイマーをリセットし、現在のセッションを延長します。
FullStory開発者ガイド:アイドルタイマーのリセット
ログ
| リモートコマンド | FullStory メソッド |
|---|---|
log |
FS.log() |
| パラメータ | タイプ |
|---|---|
log_level (必須) |
文字列 |
log_message (必須) |
文字列 |
指定されたレベルでメッセージを記録します。プラットフォームによって受け入れられる log_level の値は異なります:
| プラットフォーム | 受け入れられる値 |
|---|---|
| Android | log, error, warn/warning, info, debug |
| iOS | assert, error, warning, info, debug |
FullStory 開発者ガイド:ログ
最終更新日 :: 2026年April月16日