# URL使用ルール

以下は、ページグループ、コンバージョン、イベント設定で使用されるルールについて、データのマッチング条件を定義する内容です。

#### 含む <a href="#bao-han" id="bao-han"></a>

特定の文字列を含むURLに対して定義します。例えば、「abc.com」を「含む」に設定すると、以下のようなURLが対象に含まれます。

* `https://abc.com/lp`
* `https://abc.com/company`
* `https://abc.com/company/contact`

#### 含まない <a href="#bu-bao-han" id="bu-bao-han"></a>

特定の文字列を含まないURLに対して定義します。例えば、ブログページ以外のすべてのページを対象にしたい場合は、「example.com/blog」を「含まない」に設定します。

#### 前方一致 <a href="#tou-pi-pei" id="tou-pi-pei"></a>

登録した文字列と前方一致するURLに対して定義します。通常、クエリパラメータを含むURLで使用されます。

例えば、特定の訪問者（id=9982251615）が以下のURLを訪問したとします。

`https://www.example.com/checkout.cgi?page=1&id=9982251615`

上記のURLを前方一致に設定すると、id=9982251615のユーザーの訪問以外は影響を受けません。

すべてのユーザーを対象にしたいが、page=1のみに限定したい場合は、以下のURLで前方一致を設定します。

`https://www.example.com/checkout.cgi?page=1`

また、page=1以外のページも含めたい場合は、以下のURLで前方一致を設定します。

`https://www.example.com/checkout.cgi?page`

#### 後方一致 <a href="#wei-pi-pei" id="wei-pi-pei"></a>

登録した文字列と後方一致するURLに対して定義します。

例えば、後方一致で「/test/index.html」を登録すると、「<http://www.example.com/s/test/index.html>」のようなURLが対象として定義されます。

ただし、以下のURLは末尾が「/test/index.html」ではないため、対象になりません。

`http://www.example.com/s/test/index.html?wore=xxx`

#### 完全一致 <a href="#wan-quan-pi-pei" id="wan-quan-pi-pei"></a>

設定したURLと実際のURLが完全に一致するURLに対して定義します。

* Tips：パラメータ一致：ページのパラメータを設定条件とし、特定のパラメータを持つユーザーのみに配信します。パラメータ不一致：ページに訪問するユーザーがパラメータを持っているかどうかに関わらず配信されます。

#### 正規表現 <a href="#zheng-ze-biao-da-shi" id="zheng-ze-biao-da-shi"></a>

正規表現とは、一定の形式を持つ複数の文字列を表現するための方法です。

正規表現を使用することで、より柔軟な条件定義が可能になります。

**よく使用される正規表現の組み合わせ**

1. ウェブサイトドメインに前方一致し、スラッシュまたはクエスチョンマークで終わるURL

**正規表現**： `^https:\/\/www.ptmind.com($|\/$|\/\?.*)`

**含まれるURL**： `https://www.ptmind.comhttps://www.ptmind.com/https://www.ptmind.com/?WT.mc_id=xxxx`

**含まれないURL**： `https://www.ptmind.com/abc`

（以下省略、同様に適用）

#### 正規表現の検証ツール <a href="#zheng-ze-biao-da-shi-yan-zheng-gong-ju" id="zheng-ze-biao-da-shi-yan-zheng-gong-ju"></a>

正規表現の書き方が正しいかを確認するには、[正規表現チェックツール](https://c.runoob.com/front-end/854/)などのツールをご利用ください。

※ 設定中にご不明な点がございましたら、お気軽にサポートまでお問い合わせください。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helps.ptengine.com/faq/insight-setting/url-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
