---
title: フロントエンド統合
slug: _Gt1H-a-5HHdXYtgPLqY-
createdAt: 2025-07-30T21:22:24.108Z
---

# JavaScript統合

本番環境とサンドボックス環境の両方の完全なJSスニペットは次の場所にあります
[こちら](https://portal.forter.com/api/services-and-apis/javascript-integration)

ForterのJavaScriptスニペットは、すべてのウェブページのサイトフッターセクションに挿入する必要があります。次のサイトテンプレートが構築されました:

`int_forter/cartridge/templates/default/custom/fortersnippetjs.isml`

あなたの **サイトID** と **シークレットキー** をカートリッジ設定に追加すると、この `.isml` テンプレートが構成されます。これが追加されたら、Forterのオンボーディングチームに知らせてください。リモートでの有効化を完了できるようにします。

# MFRA JavaScript

### ForterのJavaScriptスニペットを含める

ForterのJavaScriptスニペットは、既存の **app\_storefront\_base** の `checkout.isml` と `page.isml` テンプレートに挿入する必要があります。以下に指示とコードスニペットを含めています:

## 1) checkout.ismlテンプレートを更新する

forterJSスニペットで `checkout.isml` テンプレートを更新します。Forter SFCCカートリッジ内の正確なパスは:
`int_forter_mfra/cartridge/templates/default/common/layout/checkout.isml`です。

これは `app_storefront_base/cartridge/templates/default/common/layout/checkout.isml` テンプレートを拡張します:

```html
<isinclude template="custom/fortersnippetjs"/>
```

完全な **checkout.isml** ファイルは以下に含まれています:

:::ExpandableHeading
### 完全な checkout.isml テンプレート

```html
<iscontent type="text/html" charset="UTF-8" compact="true"/>

<isinclude template="/components/modules" sf-toolkit="off" />

<!DOCTYPE html>
<html lang="ja">
    <head>
        <isinclude template="/common/htmlHead" />
        <isactivedatahead/>
    </head>
    <body>
        <div class="page">
            <isinclude template="/components/header/pageHeaderNomenu" />
            <isreplace/>
            <isinclude template="/components/footer/pageFooter" />
        </div>
        <isinclude template="/common/scripts" />
<-- 以下のコード行を追加 --/>
        <isinclude template="custom/fortersnippetjs"/>
<-- 終了 --/>
        <isinclude url="${URLUtils.url('ConsentTracking-Check')}"/>
    </body>
</html>
```
:::

## 2) page.isml テンプレートを更新する

あなたは `page.isml` テンプレートを forterJS スニペットと一緒に含めるべきです。Forter SFCC カートリッジ内の正確なパスは:
`int_forter_mfra/cartridge/templates/default/common/layout/page.isml` です。

これは `app_storefront_base /cartridge/templates/default/common/layout/page.isml` HTML テンプレートを次のコードで拡張します:

```html
<isinclude template="custom/fortersnippetjs"/>
```

完全な **page.isml** ファイルは以下に含まれています:

:::ExpandableHeading
### 完全な page.isml ファイル

```html
<iscontent type="text/html" charset="UTF-8" compact="true"/>

<isinclude template="/components/modules" sf-toolkit="off" />

<!DOCTYPE html>
<html lang="ja">
    <head>
        <isinclude template="/common/htmlHead" />
        <isactivedatahead/>
    </head>
    <body>
        <div class="page" data-action="${pdict.action}" data-querystring="${pdict.queryString}" >
            <isinclude template="/components/header/pageHeader" />
            <isreplace/>
            <isinclude template="/components/footer/pageFooter" />
        </div>
        <div class="error-messaging"></div>
        <div class="modal-background"></div>
        <iscontentasset aid="cookie_hint" />
        <isinclude template="/common/scripts" />
        <isinclude template="custom/fortersnippetjs"/>
        <isinclude url="${URLUtils.url('ConsentTracking-Check')}"/>
    </body>
</html>
```
:::
