Skip to content

Commit 83f52d3

Browse files
committed
Track pageview in Gatsby
1 parent 99f9720 commit 83f52d3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/homepage/gatsby-browser.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { trackPageview } from '@codesandbox/common/lib/utils/analytics';
2+
13
exports.onClientEntry = () => {
24
(function addDocSearch() {
35
const path = `https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css`;
@@ -8,3 +10,7 @@ exports.onClientEntry = () => {
810
document.head.appendChild(link);
911
})();
1012
};
13+
14+
exports.onRouteUpdate = () => {
15+
trackPageview();
16+
};

0 commit comments

Comments
 (0)