Help Center
Cross-domain means that there are two or more different domains in a site, and links to different domains are measured as the same session. For example: a visit behavior from page "a.com" to page "b.com" is a cross domain.
In what specific situations do you need to set up a cross domain? Let's take a look at the following examples.
In other words, you need to set up cross-domain so that the session will not be broken when navigating between pages that have different domains.
You must be able to move from "a.com" to "b.com" and have the same Ptengine Experience basic set for both "a.com" and "b.com" (please note that base tags are different for each project).
Now, let's take a look at the specific cross-domain settings. There are three ways to set it up: automatic, manual (for <a> links) and manual (for non-<a> links), and you can set it up according to your needs.
Note: Please note that if undefined parameters are added to the cross-domain destination, you may be redirected to an error page. For example, there are cases where payment pages restrict the addition of parameters for security reasons.
After switch on the settings, the cross-domain identifier "_pt_link=***********" will be automatically assigned to all link URLs on the page which direct to a different domain. Please Note that the URL length need to be 900 characters or less. For details, please refer to the following example.
Before: <a href="https://www.b.com"></a> After: <a href="https://www.b.com#_pt_link=_s_gEjf3wNa5RNxgw4lC5H8Eg..."></a>
<a href="https://www.b.com"></a>
<a href="https://www.b.com#_pt_link=_s_gEjf3wNa5RNxgw4lC5H8Eg..."></a>
Note: Please note that turning on the switch will apply to both Ptengine Insight and Ptengine Experience (turning on the switch will disable the original cross-domain tags set in Ptengine Insight). If you do not turn on the switch, you can continue to use the original cross-domain tags set in Ptengine Insight (the original cross-domain tags set in Ptengine Insight are applied only in Ptengine Insight).
<a>
After this, the cross-domain identifier "_pt_link=***********" will be automatically assigned to all link URLs on the page which direct to a different domain. Please Note that the URL length need to be 900 characters or less. For details, please refer to the following example.
Example: If you want to go from "a.com" to "b.com", add "data-pt-crossDomain" to the <a> link that goes to b on page a. What you set: <a href="https://www.b.com" data-pt-crossDomain>button</a> After you set: <a href="https://www.b.com#_pt_link=_s_gEjf3wNa5RNxgw4lC5H8Eg...">button</a>
<a href="https://www.b.com" data-pt-crossDomain>button</a>
<a href="https://www.b.com#_pt_link=_s_gEjf3wNa5RNxgw4lC5H8Eg...">button</a>
non-<a>
API:window.ptengine.createCrossDomainUrl
For example, if you want to navigate to another site by clicking a button, you can set it up by using Ptengine's external integration API as shown below.
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)
Was this article helpful?
Thanks for your feedback.
Sorry about that. Do you mind sharing how we can improve?
Write your feedback here...
We have received your feedback and will make sure to improve this article. We will get in touch with you once we do.