diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index fb9913c04..ff29d5016 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -11,10 +11,10 @@ pipelines: - popd - pushd jam-ui/cicd - npm install - - NODE_ENV=production PUBLIC_URL=https://staging.jamkazam.com REACT_APP_ORIGIN=staging.jamkazam.com REACT_APP_BASE_URL=https://staging.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://staging.jamkazam.com REACT_APP_API_BASE_URL=https://staging.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT ENVIRONMENT=staging ./generate.sh + - NODE_ENV=production PUBLIC_URL=https://staging.jamkazam.com REACT_APP_ORIGIN=staging.jamkazam.com REACT_APP_BASE_URL=https://staging.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://staging.jamkazam.com REACT_APP_API_BASE_URL=https://staging.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT REACT_APP_GOOGLE_ANALYTICS_ID=G-8W0GTL53NT ENVIRONMENT=staging ./generate.sh - popd - cd jam-ui - - NODE_ENV=production CI=false PUBLIC_URL=https://staging.jamkazam.com REACT_APP_ORIGIN=staging.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://staging.jamkazam.com REACT_APP_BASE_URL=https://staging.jamkazam.com REACT_APP_API_BASE_URL=https://staging.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT npm run build + - NODE_ENV=production CI=false PUBLIC_URL=https://staging.jamkazam.com REACT_APP_ORIGIN=staging.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://staging.jamkazam.com REACT_APP_BASE_URL=https://staging.jamkazam.com REACT_APP_API_BASE_URL=https://staging.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT REACT_APP_GOOGLE_ANALYTICS_ID=G-8W0GTL53NT npm run build artifacts: - jam-ui/build/** - step: @@ -58,10 +58,10 @@ pipelines: - popd - pushd jam-ui/cicd - npm install - - NODE_ENV=production ENVIRONMENT=production PUBLIC_URL=https://www.jamkazam.com REACT_APP_ORIGIN=jamkazam.com REACT_APP_BASE_URL=https://www.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://www.jamkazam.com REACT_APP_API_BASE_URL=https://www.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT ./generate.sh + - NODE_ENV=production ENVIRONMENT=production PUBLIC_URL=https://www.jamkazam.com REACT_APP_ORIGIN=jamkazam.com REACT_APP_BASE_URL=https://www.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://www.jamkazam.com REACT_APP_API_BASE_URL=https://www.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT REACT_APP_GOOGLE_ANALYTICS_ID=G-SPTNJRW7WB ./generate.sh - popd - cd jam-ui - - NODE_ENV=production CI=false PUBLIC_URL=https://www.jamkazam.com REACT_APP_ORIGIN=jamkazam.com REACT_APP_BASE_URL=https://www.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://www.jamkazam.com REACT_APP_API_BASE_URL=https://www.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT npm run build + - NODE_ENV=production CI=false PUBLIC_URL=https://www.jamkazam.com REACT_APP_ORIGIN=jamkazam.com REACT_APP_BASE_URL=https://www.jamkazam.com REACT_APP_CLIENT_BASE_URL=https://www.jamkazam.com REACT_APP_API_BASE_URL=https://www.jamkazam.com/api REACT_APP_BITBUCKET_BUILD_NUMBER=$BITBUCKET_BUILD_NUMBER REACT_APP_BITBUCKET_COMMIT=$BITBUCKET_COMMIT REACT_APP_GOOGLE_ANALYTICS_ID=G-SPTNJRW7WB npm run build artifacts: - jam-ui/build/** diff --git a/jam-ui/src/components/jamtracks/JKJamTracksArtistLandingTemplatePage.js b/jam-ui/src/components/jamtracks/JKJamTracksArtistLandingTemplatePage.js index 7c81f620f..77868a878 100644 --- a/jam-ui/src/components/jamtracks/JKJamTracksArtistLandingTemplatePage.js +++ b/jam-ui/src/components/jamtracks/JKJamTracksArtistLandingTemplatePage.js @@ -8,6 +8,7 @@ import {Navbar} from "reactstrap"; import {topNavbarBreakpoint} from "../../config"; import Logo from "../navbar/Logo"; import {BrowserQueryProvider} from "../../context/BrowserQuery"; +import {initGA, logPageView } from "../../helpers/analytics"; import Footer from "../footer/JKFooter"; const ArtistTemplatePage = ({ original_artist_slug, artist, songs}) => { @@ -23,6 +24,8 @@ const ArtistTemplatePage = ({ original_artist_slug, artist, songs}) => { const paddingClass = greaterThan.sm ? "px-6" : "px-1"; useEffect(() => { + initGA(); + logPageView(window.location.pathname + window.location.search); //see if there is affiliate in query string and save it as cookie const urlParams = new URLSearchParams(window.location.search); const affiliate = urlParams.get('affiliate'); diff --git a/jam-ui/src/components/jamtracks/JKJamTracksLandingTemplatePage.js b/jam-ui/src/components/jamtracks/JKJamTracksLandingTemplatePage.js index 05556b23d..e7e8fe7bf 100644 --- a/jam-ui/src/components/jamtracks/JKJamTracksLandingTemplatePage.js +++ b/jam-ui/src/components/jamtracks/JKJamTracksLandingTemplatePage.js @@ -10,6 +10,7 @@ import {topNavbarBreakpoint} from "../../config"; import Logo from "../navbar/Logo"; import {BrowserQueryProvider} from "../../context/BrowserQuery"; import Footer from "../footer/JKFooter"; +import {initGA, logPageView } from "../../helpers/analytics"; const TemplatePage = ({ id, plan_code, slug, artist, song, location}) => { console.log('TemplatePage', id, plan_code, slug, artist, song, location); @@ -25,6 +26,9 @@ const TemplatePage = ({ id, plan_code, slug, artist, song, location}) => { const paddingClass = greaterThan.sm ? "px-6" : "px-1"; useEffect(() => { + initGA(); + logPageView( window.location.pathname + window.location.search); + //see if there is affiliate in query string and save it as cookie const urlParams = new URLSearchParams(window.location.search); const affiliate = urlParams.get('affiliate');