英語からAIを使用して翻訳されました
この記事はAI技術を使用して翻訳されたことにご注意ください。正確性を維持するよう努めていますが、一部の詳細は元のテキストを完全に反映していない場合があります。情報に不明な点がある場合は、英語版を参照してください。
プランの利用可能性: Voice of Customerツール(調査):Voice of Customer Growthプランで利用可能です。
Experience Analyticsツール(フィルター):Contentsquare Growthプランで利用可能です。
Experience Analyticsツール(フィルター):Contentsquare Growthプランで利用可能です。
プラグインの設定
イベントをContentsquareに転送するためには、Amplitude Destination Pluginのバリアントが必要です。以下はContentsquare用に調整されたDestination Pluginのテンプレートです。これはContentsquareタグのインスタンスを作成し、AmplitudeのSDKから追跡されたイベントを転送します。このテンプレートは、あらゆるニーズに合わせてカスタマイズ可能です。
import { BrowserConfig, DestinationPlugin, Event, PluginType, Result } from '@amplitude/analytics-types';
import { default as hj } from '@hotjar/browser';
export class HotjarPlugin implements DestinationPlugin {
name = 'hotjar';
type = PluginType.DESTINATION as const;
siteId: number;
hotjarVersion: number;
constructor(siteId: number, hotjarVersion: number) {
this.siteId = siteId;
this.hotjarVersion = hotjarVersion;
}
async setup(): Promise<void> {
hj.init(this.siteId, this.hotjarVersion);
}
async execute(event: Event): Promise<Result> {
if (event.event_type === '$identify') {
const { user_id, device_id, user_properties } = event;
const hotjarId = user_id || device_id || '';
hj.identify(hotjarId, user_properties || {});
} else {
hj.event(event.event_type);
}
return {
code: 0,
event: event,
message: 'イベントがHotjar APIに転送されました',
};
}
}
Amplitudeプラグインの使用
アプリのコード内で、プラグインはインポートされ、Amplitude SDKインスタンスに追加されることがあります。
import * as amplitude from '@amplitude/analytics-browser';
import { HotjarPlugin } from './HotjarPlugin';
amplitude.init(AMPLITUDE_API_KEY);
amplitude.add(new HotjarPlugin(HOTJAR_SIDE_ID, HOTJAR_VERSION));
amplitude.logEvent('アプリを開く');