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

CustomHtml

カスタムHTMLタグを使用した統合

カスタムHTMLタグのセットアップ

  1. Google Tag Managerにアクセスし、タグに移動します。
  2. 新規作成をクリックします。 Setup Rokt Tag in GTM
  3. タグの種類で、カスタムHTMLを選択します。
  4. Roktの統合コードを追加します。カスタムスニペットを持っていない場合は、以下のコードを使用できます。
<script type="module">
const attributes = {
email: "",
firstname: "",
lastname: "",
mobile: "",
confirmationref: "",
amount: "",
currency: "",
paymenttype: "",
ccbin: "",
zipcode: "",
country: "",
language: "",
};

if(!window.roktLauncher){
const target = document.head || document.body;
const script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://apps.rokt.com/wsdk/integrations/launcher.js";
script.importance = "high";
script.crossOrigin = "anonymous";
script.async = true;
script.id = "rokt-launcher";
target.appendChild(script);
await new Promise((resolve) =>
window.Rokt
? resolve()
: document
.getElementById("rokt-launcher")
.addEventListener("load", () => resolve())
);
window.roktLauncher = await window.Rokt.createLauncher({
accountId: "rokt-account-id",
sandbox: true,
});
}

const selection = await window.roktLauncher.selectPlacements({
attributes,
identifier: "payment_page"
});
</script>
  1. データレイヤーの変数を対応する属性フィールドに割り当てます(例:email:{{dl_email}})。 GTMでRoktタグをセットアップ
注記

document.writeのチェックボックスが有効になっていることを確認してください。そうでない場合、Googleは変更の公開を防止します。また、accountIdをアカウントマネージャーから提供された値で更新し、テスト中にsandboxをtrueに設定することも忘れないでください。

  1. トリガーを追加します。 GTMでRoktタグをセットアップ

  2. 保存して公開します。

この記事は役に立ちましたか?