Skip to content

Commit

Permalink
one more fix for pageviews; include pathname (#9609)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwunderl authored Jul 20, 2023
1 parent 282876d commit c1beefd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docfiles/pxtweb/cookieCompliance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ namespace pxt {
envelope.baseData.properties = {};
}
envelope.baseData.properties.pageName = pageName;
envelope.baseData.properties.pathName = window.location.pathname;
// no url scrubbing for webapp (no share url, etc)
}

Expand Down
3 changes: 2 additions & 1 deletion docfiles/tracking.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
envelope.baseData.properties.pageName = pageName;
var scrubbedUrl = scrubUrl(envelope.baseData.uri);
envelope.baseData.uri = scrubbedUrl;
var toUrl = new URL(scrubbedUrl);
envelope.baseData.properties.pathName = toUrl ? toUrl.pathname : "";
if (envelope.ext && envelope.ext.trace) {
var toUrl = new URL(scrubbedUrl);
envelope.ext.trace.name = toUrl ? toUrl.pathname : "";
}
}
Expand Down

0 comments on commit c1beefd

Please sign in to comment.