# Other Cross-Domain Configuration Methods

## Other Cross-Domain Configuration Methods

Cross-domain configuration is basically automatic, but if measurement is not working properly, please try the following methods.

## Full Manual Configuration

Add the following to the Ptengine base tag:

This is the procedure for embedding a special tag for cross-domain measurement in your site's source code.

Add lines 2-6 below to the Ptengine base tag ▼ Tag copy-paste

```javascript
<!-- Ptengine Tag -->
<script>
window._pt_sp_2 = [];
_pt_sp_2.push('setCrossDomainLink,allManual');
_pt_sp_2.push('setAccount,xxxxxxxx');
</script>
<script src="<https://js.ptengine.jp/xxxxxxxx.js>"></script>
<!-- End Ptengine Tag -->
※ Replace xxxxxxxx with your tag (sid).
```

## **Semi-Manual Configuration**

Use this method if your page has many anchor tags where cross-domain occurs, and you want to measure transitions only from specific anchor tags rather than all of them.

Similar to the configuration method in Method 2, add lines 12-16 below to the Ptengine base tag ▼ Tag copy-paste

```javascript
<!-- Ptengine Tag -->
<script>
window._pt_sp_2 = [];
_pt_sp_2.push('setCrossDomainLink,halfManual');
_pt_sp_2.push('setAccount,xxxxxxxx');
</script>
<script src="<https://js.ptengine.jp/xxxxxxxx.js>"></script>
<!-- End Ptengine Tag -->
※ Be sure to set line 14 to halfManual at the end
```

**2** Add "data-pt-crossDomain" to the anchor tag (button) that transitions from page a to page b, as follows. ▼ Tag copy-paste

```
<a href="<https://www.b.com>" data-pt-crossDomain>button</a>
```

## **API Integration**

If the transition button is not an anchor tag but another tag, such as a form tag, none of the above methods can be applied. API integration is required. Please refer to the configuration method below. We recommend entrusting this to engineers if you are not familiar with coding.

**Set the following Ptengine external API with JavaScript in the button's click event to complete the configuration.**

```
API: window.ptengine.createCrossDomainUrl
```

For example, if you want to navigate to a different site when a button is clicked, you can configure it using Ptengine's external API as follows.

```javascript
var btn = document.querySelector(".btn");
btn.addEventListener("click", function(){
    var targetUrl = '<https://www.b.com>';
    var openUrl = window.ptengine && window.ptengine.createCrossDomainUrl && typeof window.ptengine.createCrossDomainUrl === 'function' && window.ptengine.createCrossDomainUrl(targetUrl);
    window.open(openUrl)
},false)
```

### ✅ How to Confirm Configuration Completion

Confirm that `#_pt_link=********` or `?_pt_link=********` is appended to the URL after the cross-domain transition.

Example: `https://www.b.com#_pt_link=_s_gEjf3wNa5RNxgw4lC5H8Eg...`

> **DANGER**
>
> **Important Points**
>
> Automatic configuration is effective even if you are not using Experience
>
> When turned ON, it applies to both Insight and Experience (the original Insight configuration is disabled)
>
> If not turned ON, it will not be applied in Experience


---

# 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/en/faq/insight-setting/cross-domain-other.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.
