-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efcbbbd
commit aca4118
Showing
3 changed files
with
122 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
title: "Crossdomain Iframe Tracking" | ||
metaTitle: "Crossdomain Iframe Tracking" | ||
metaDescription: "Track user interactions in crossdomain iframes with OpenReplay." | ||
--- | ||
|
||
To enable crossdomain iframe tracking, you need to add the `crossdomain.enabled` option to the tracker's constructor, | ||
then add domain area via `data-domain` to all desired iframes like so: | ||
|
||
```html | ||
<iframe | ||
title="test" | ||
src="http://iframe1.website.com/iframe-path" | ||
width="300" | ||
height="300" | ||
data-domain="iframe1.website.com" | ||
></iframe> | ||
``` | ||
|
||
Add following to your tracker constructor: | ||
|
||
```js | ||
const tracker = new OpenReplay({ | ||
projectKey: PROJECT_KEY, | ||
crossdomain: { | ||
enabled: true | ||
}, | ||
captureIFrames: true | ||
}); | ||
``` | ||
|
||
then add tracker inside the desired iframe and add `crossdomain.parentDomain` to its constructor: | ||
|
||
```js | ||
const tracker = new OpenReplay({ | ||
projectKey: PROJECT_KEY, | ||
crossdomain: { | ||
// specifies domain of parent window | ||
// if not specified, it will be set to '*' | ||
// which means that child window will send messages to all domains inside the browser window | ||
// consult your CSP settings to ensure that '*' is allowed or specify the parent domain | ||
parentDomain: '*', | ||
} | ||
}); | ||
``` |