feat(tracker): update SetPageLocation referrer value for single-page routing
This commit is contained in:
parent
1e2a5f2644
commit
7e82dce53a
1 changed files with 3 additions and 1 deletions
|
|
@ -5,13 +5,15 @@ import { SetPageLocation, SetViewportSize, SetPageVisibility } from '../app/mess
|
||||||
export default function (app: App): void {
|
export default function (app: App): void {
|
||||||
let url: string, width: number, height: number
|
let url: string, width: number, height: number
|
||||||
let navigationStart: number
|
let navigationStart: number
|
||||||
|
let referrer = document.referrer
|
||||||
|
|
||||||
const sendSetPageLocation = app.safe(() => {
|
const sendSetPageLocation = app.safe(() => {
|
||||||
const { URL } = document
|
const { URL } = document
|
||||||
if (URL !== url) {
|
if (URL !== url) {
|
||||||
url = URL
|
url = URL
|
||||||
app.send(SetPageLocation(url, document.referrer, navigationStart))
|
app.send(SetPageLocation(url, referrer, navigationStart))
|
||||||
navigationStart = 0
|
navigationStart = 0
|
||||||
|
referrer = url
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue