Skip to content

Commit

Permalink
Merge pull request #92 from pwa-builder/4511-referral-support-apiV2
Browse files Browse the repository at this point in the history
#4511: Add referrer field to APIV2 analytics
  • Loading branch information
khmyznikov authored Nov 29, 2023
2 parents ffbfa72 + c39ac5f commit 2b4b3d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const httpTrigger: AzureFunction = async function (
analyticsInfo.platformIdVersion =
req.headers['platform-identifier-version'];
analyticsInfo.correlationId = req.headers['correlation-id'];
analyticsInfo.properties = req.query.ref ? { referrer: req.query.ref } : { };
await uploadToAppInsights(webAppReport, analyticsInfo);

context.res = {
Expand Down
1 change: 0 additions & 1 deletion utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export async function uploadToAppInsights(
analyticsInfo: AnalyticsInfo
) {
try {
analyticsInfo.properties = {};
if (webAppReport.artifacts.webAppManifest?.json) {
const _manifest = webAppReport.artifacts.webAppManifest?.json;
console.log(_manifest);
Expand Down

0 comments on commit 2b4b3d6

Please sign in to comment.