Skip to content

Commit 73c952a

Browse files
committed
Create documentation for logging a pageview to google analytics in
angular and react.
1 parent 17ac1c6 commit 73c952a

File tree

12 files changed

+159
-25
lines changed

12 files changed

+159
-25
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
# testing
99
/coverage
1010

11-
# production
12-
/build
13-
/dist
14-
1511
# Webstorm IDE
1612
/.idea
1713

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ to use and include this code in your `<head>` tag. It should be placed as high u
4141
in order to catch users who leave immediately after loading the page, then immediately leave.
4242
```html
4343
<!-- Measurement Library Snippet -->
44-
<script async src="./node_modules/measurement-library/dist/measure"/>
44+
<script async src="/node_modules/measurement-library/dist/measure"/>
4545
<script>
4646
window.dataLayer = window.dataLayer || [];
4747
function measure(){dataLayer.push(arguments);}

demo/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
To do this, we do not load the library asynchronously and include
1616
a measure-setup compiled file that does not run commands on load,
1717
then call it in the setup script. -->
18-
<script src="./measure-no-config.js"></script>
18+
<script src="/measure-no-config.js"></script>
1919
<script>
2020
measureDataLayer = [];
2121
window.setupMeasure(measureDataLayer);

demo/public/measure-no-config.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/src/Router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ function RouterBase({history}) {
2929
}, [history]);
3030

3131
const sendPageView = (location) => {
32+
console.log("view page...");
3233
measurePageView(location.pathname);
3334
gtagPageView(location.pathname);
3435
};

dist/measure-debug.js

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)