メインコンテンツまでスキップ

サンドボックスとの統合 (レガシー)

サンドボックス統合を使用すると、構成フラグを渡してサンドボックス環境に対してテストを行うことができます。サンドボックス環境は、通常のオファー、入札、およびマッチングプロセスを本番環境の構成に対して実行します。サンドボックス環境はRoktの本番環境の一部ですが、広告主に課金したり収益を生み出したりしません。そのため、本番環境にデプロイする前の受け入れテストに使用できます。

統合は、以前の例とまったく同じ手順に従いますが、execute関数に渡す必要がある追加のsandbox属性が必要です。

警告

配置を本番環境に移行する前に、sandbox属性を削除する必要があります。

オーバーレイ配置の例

サンドボックス環境でオーバーレイ配置を実行するには、Roktに渡される属性のリストを更新して"sandbox": "true"を含める必要があります。これは、オーバーレイ配置の開始のドキュメントの例からコードを更新して、以下を含めることで実行できます:

メジャーバージョン 3

import { Rokt } from "@rokt/react-native-sdk";

const attributes = {
email: "j.smith@example.com",
sandbox: "true",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};

Rokt.execute("RoktExperience", attributes, {}, () =>
console.log("Placement Loaded")
);

メジャーバージョン 4

import { Rokt } from "@rokt/react-native-sdk";

const attributes = {
email: "j.smith@example.com",
sandbox: "true",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};

Rokt.execute("RoktExperience", attributes, {});

埋め込みプレースメントの例

サンドボックス環境で埋め込みプレースメントを実行するには、Rokt に渡される属性のリストを更新して "sandbox": "true" を含める必要があります。これは、埋め込みプレースメントの起動 ドキュメントのサンプルコードを次のように更新することで行えます:

メジャーバージョン 3

import { Rokt, RoktEmbeddedView } from "@rokt/react-native-sdk";

...

const placeholders = {
RoktEmbedded1: findNodeHandle(this.placeholder1.current),
};

const attributes = {
email: "j.smith@example.com",
sandbox: "true",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};
Rokt.execute("RoktEmbeddedExperience", attributes, placeholders, () =>
console.log("Placement Loaded")
);

メジャーバージョン 4

import { Rokt, RoktEmbeddedView } from "@rokt/react-native-sdk";

...

const placeholders = {
RoktEmbedded1: findNodeHandle(this.placeholder1.current),
};

const attributes = {
email: "j.smith@example.com",
sandbox: "true",
firstname: "Jenny",
lastname: "Smith",
mobile: "(323) 867-5309",
postcode: "90210",
country: "US",
};
Rokt.execute("RoktEmbeddedExperience", attributes, placeholders);
この記事は役に立ちましたか?