Skip to content

Commit

Permalink
Fix analytics after vite migration (#6819)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson authored Nov 30, 2023
1 parent 16fc48c commit fe57135
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion packages/embed/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ VITE_AMPLITUDE_API_PROXY=gain.audius.co
VITE_ENVIRONMENT=development
VITE_IDENTITY_ENDPOINT=https://identityservice.staging.audius.co
VITE_HOSTNAME_REDIRECT=redirect.staging.audius.co
VITE_GA_MEASUREMENT_ID=G-V6N1ZTVGS5
VITE_OPEN_SEA_API_KEY=639642f563224bf894274aaf77dd1ce7
VITE_SOLANA_RPC_ENDPOINT=https://audius-fe.rpcpool.com
1 change: 0 additions & 1 deletion packages/embed/.env.stage
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ VITE_AMPLITUDE_API_PROXY=gain.audius.co
VITE_HOSTNAME=staging.audius.co
VITE_HOSTNAME_REDIRECT=redirect.staging.audius.co
VITE_ENVIRONMENT=staging
VITE_GA_MEASUREMENT_ID=G-V6N1ZTVGS5
VITE_OPEN_SEA_API_KEY=639642f563224bf894274aaf77dd1ce7
VITE_SOLANA_RPC_ENDPOINT=https://audius-fe.rpcpool.com
17 changes: 6 additions & 11 deletions packages/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,12 @@
src="https://www.googletagmanager.com/gtag/js?id=%VITE_GA_MEASUREMENT_ID%"
></script>
<script>
const nodeEnv = '%NODE_ENV%'
const reactEnv = '%VITE_ENVIRONMENT%'
if (nodeEnv === 'production' && reactEnv === 'production') {
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag('js', new Date())
gtag('config', '%VITE_GA_MEASUREMENT_ID%')
const measurementId = '%VITE_GA_MEASUREMENT_ID%'
if (!measurementId.includes('%')) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', measurementId);
}
</script>
<!-- end Google Analytics -->
Expand All @@ -132,8 +129,6 @@
const adroll_pix_id = '%VITE_ADROLL_PIX_ID%'
const adroll_version = '2.0'
if (
nodeEnv === 'production' &&
reactEnv === 'production' &&
!adroll_adv_id.includes('%') &&
!adroll_pix_id.includes('%')
) {
Expand Down

0 comments on commit fe57135

Please sign in to comment.