Skip to content

Commit 8860909

Browse files
authored
Merge pull request #124 from pwa-builder/4541-cloup-apk-referrer-analytics
#4541: Add referrer field to Cloud APK analytics
2 parents bf146a1 + 8b70948 commit 8860909

20 files changed

+29
-493
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ pids
1212
*.pid.lock
1313

1414
#remove js files
15-
build/*.js
15+
**/*.js
16+
**/*.js.map
17+
!static/*.js
1618

1719
# Directory for instrumented libs generated by jscoverage/JSCover
1820
lib-cov

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,23 @@ This tool generates a zip file containing both an `.apk` file (for testing) and
99

1010
Please use our [main repository for any issues/bugs/features suggestion](https://github.com/pwa-builder/PWABuilder/issues/new/choose).
1111

12-
# Running locally
12+
# Running Locally
1313

14-
Run `npm start dev`, then launch your browser to localhost:3333. A page will launch that allows you to generate an Android package.
14+
You will need [Docker](https://www.docker.com/products/docker-desktop/) and the [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) to run this service locally.
1515

16-
You may also generate a package manually by sending a POST to `/generateAppPackage` with the following JSON body:
16+
Steps:
17+
18+
1. Run `az acr login -n pwabuilder` to authenticate with our Azure Container Registry.
19+
20+
2. If you are testing locally, go to `Dockerfile` and change line 13 to `NODE_ENV=test`.
21+
22+
3. Run `npm run docker:build` to build the Docker image, this may take a while the first time you run it.
23+
24+
4. Once the build is complete, run `npm run docker:run` to start the Docker container.
25+
26+
5. Visit `localhost` to see the CloudAPK testing interface.
27+
28+
If you don't want to use the testing interface, you may also generate a package manually by sending a POST to `/generateAppPackage` with the following JSON body:
1729

1830
```json
1931
{

app.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

app.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/analytics.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/analytics.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ export function trackEvent(
4646
console.error("App insights no defaultClient");
4747
return;
4848
}
49-
49+
5050
var properties: any = {
5151
name: analyticsInfo.name,
5252
url: analyticsInfo.url,
5353
platformId: analyticsInfo.platformId,
5454
platformIdVersion: analyticsInfo.platformIdVersion,
55+
referrer: analyticsInfo.referrer,
5556
};
5657

5758
try {
@@ -87,4 +88,5 @@ export type AnalyticsInfo = {
8788
platformId: string | null;
8889
platformIdVersion: string | null;
8990
correlationId: string | null;
91+
referrer: string | null;
9092
};

build/androidPackageOptions.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/appPackageRequest.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/bubbleWrapper.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/generatedAppPackage.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)