Skip to content

Commit ef95ead

Browse files
committed
Track pageviews in vero
1 parent 2f64c49 commit ef95ead

File tree

1 file changed

+8
-7
lines changed
  • packages/common/src/utils/analytics

1 file changed

+8
-7
lines changed

packages/common/src/utils/analytics/vero.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ const _veroq: any[] = [
77

88
global.veroq = _veroq;
99

10-
export const trackPageview = () => {
11-
_veroq.push(['trackPageview']);
12-
};
13-
14-
// Already start tracking the first pageview
15-
trackPageview();
16-
1710
/**
1811
* For some reason vero doesn't call it, so we do it for them.
1912
*/
@@ -26,6 +19,14 @@ function processArray() {
2619
}
2720
}
2821

22+
export const trackPageview = () => {
23+
_veroq.push(['trackPageview']);
24+
processArray();
25+
};
26+
27+
// Already start tracking the first pageview
28+
trackPageview();
29+
2930
function loadScript() {
3031
return new Promise((resolve, reject) => {
3132
const script = document.createElement('script');

0 commit comments

Comments
 (0)