Skip to content

Commit f3df012

Browse files
committed
feat(website): add tracing platform integration
1 parent 5de4975 commit f3df012

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/deploy-website.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
run: npm ci
3131

3232
- name: Build documentation artifacts
33+
env:
34+
GTAG: ${{ secrets.GTAG }}
3335
run: |
3436
npm run build:website
3537

docs/.vitepress/config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ export default defineConfig({
4141
['meta', { name: 'twitter:title', content: 'JSAR | Spatial Web Browser Engine' }],
4242
['meta', { name: 'twitter:description', content: 'Open-source spatial web browser engine for immersive 3D browsing and WebXR experiences.' }],
4343
['meta', { name: 'twitter:image', content: '/JSAR_POSTER.png' }],
44+
// Google Analytics
45+
...(process.env.GTAG ? [
46+
['script', { async: true, src: `https://www.googletagmanager.com/gtag/js?id=${process.env.GTAG}` }],
47+
['script', {}, `
48+
window.dataLayer = window.dataLayer || [];
49+
function gtag(){ dataLayer.push(arguments); }
50+
gtag('js', new Date());
51+
gtag('config', '${process.env.GTAG}');
52+
`]
53+
] : [])
4454
],
4555

4656
themeConfig: {

0 commit comments

Comments
 (0)