Add GA to landing pages and fix build constant

This commit is contained in:
Seth Call 2025-03-24 22:01:49 -05:00 committed by Nuwan
parent f4b1ab59e0
commit 62d66fac75
3 changed files with 11 additions and 4 deletions

View File

@ -11,10 +11,10 @@ pipelines:
- popd - popd
- pushd jam-ui/cicd - pushd jam-ui/cicd
- npm install - 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 - popd
- cd jam-ui - 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: artifacts:
- jam-ui/build/** - jam-ui/build/**
- step: - step:
@ -58,10 +58,10 @@ pipelines:
- popd - popd
- pushd jam-ui/cicd - pushd jam-ui/cicd
- npm install - 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 - popd
- cd jam-ui - 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: artifacts:
- jam-ui/build/** - jam-ui/build/**

View File

@ -8,6 +8,7 @@ import {Navbar} from "reactstrap";
import {topNavbarBreakpoint} from "../../config"; import {topNavbarBreakpoint} from "../../config";
import Logo from "../navbar/Logo"; import Logo from "../navbar/Logo";
import {BrowserQueryProvider} from "../../context/BrowserQuery"; import {BrowserQueryProvider} from "../../context/BrowserQuery";
import {initGA, logPageView } from "../../helpers/analytics";
import Footer from "../footer/JKFooter"; import Footer from "../footer/JKFooter";
const ArtistTemplatePage = ({ original_artist_slug, artist, songs}) => { 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"; const paddingClass = greaterThan.sm ? "px-6" : "px-1";
useEffect(() => { useEffect(() => {
initGA();
logPageView(window.location.pathname + window.location.search);
//see if there is affiliate in query string and save it as cookie //see if there is affiliate in query string and save it as cookie
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const affiliate = urlParams.get('affiliate'); const affiliate = urlParams.get('affiliate');

View File

@ -10,6 +10,7 @@ import {topNavbarBreakpoint} from "../../config";
import Logo from "../navbar/Logo"; import Logo from "../navbar/Logo";
import {BrowserQueryProvider} from "../../context/BrowserQuery"; import {BrowserQueryProvider} from "../../context/BrowserQuery";
import Footer from "../footer/JKFooter"; import Footer from "../footer/JKFooter";
import {initGA, logPageView } from "../../helpers/analytics";
const TemplatePage = ({ id, plan_code, slug, artist, song, location}) => { const TemplatePage = ({ id, plan_code, slug, artist, song, location}) => {
console.log('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"; const paddingClass = greaterThan.sm ? "px-6" : "px-1";
useEffect(() => { useEffect(() => {
initGA();
logPageView( window.location.pathname + window.location.search);
//see if there is affiliate in query string and save it as cookie //see if there is affiliate in query string and save it as cookie
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
const affiliate = urlParams.get('affiliate'); const affiliate = urlParams.get('affiliate');