Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add analytics to website #16

Merged
merged 14 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
# portfolio
# Portfolio

This is my personal portfolio website. It is built with [React](https://reactjs.org/). It is hosted on [Vercel](https://vercel.com/).

## Setup

### Secrets

1. Download the [Doppler CLI](https://docs.doppler.com/docs/install-cli)
2. Login to Doppler via the CLI: `doppler login`
3. Configure Doppler with `doppler setup`

## Run Project Locally

1. Install dependencies: `npm install`
2. Run the project with the doppler secrets: `npm run start`
3 changes: 3 additions & 0 deletions doppler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
setup:
project: portfolio
config: dev
37 changes: 0 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"start": "doppler run -- react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down Expand Up @@ -49,7 +49,6 @@
"react-router-dom": "^6.4.0",
"react-scripts": "^5.0.1",
"sass": "^1.54.9",
"swiper": "^8.4.2",
"typescript": "^4.8.3"
},
"devDependencies": {
Expand Down
11 changes: 7 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

<body>
<div id="root"></div>
</body>

<!-- TODO: update gtag -->
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-GDTQQ9VBR2"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=%REACT_APP_GA_TRACKING_ID%"></script>
<script>
window.dataLayer = window.dataLayer || [];

Expand All @@ -25,6 +23,11 @@

gtag("js", new Date());

gtag("config", "G-GDTQQ9VBR2");
gtag("config", "%REACT_APP_GA_TRACKING_ID%");
</script>

<!-- Digistats.ch -->
<script data-host="https://digistats.ch" data-dnt="false" src="https://www.digistats.ch/js/script.js" id="%REACT_APP_DIGISTATS_ID%" async defer></script>
</body>

</html>
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"key": "Content-Security-Policy",
"value": "default-src 'self' https:; form-action 'self' script.google.com; script-src 'self' 'unsafe-inline' www.googletagmanager.com; img-src 'self' data:; font-src 'self' data: fonts.googleapis.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com; connect-src 'self' vitals.vercel-insights.com;"
"value": "default-src 'self' https:; form-action 'self' script.google.com; script-src 'self' 'unsafe-inline' www.google-analytics.com vercel.live www.digistats.ch www.googletagmanager.com; img-src 'self' data:; font-src 'self' data: fonts.googleapis.com; style-src 'self' 'unsafe-inline' fonts.googleapis.com; connect-src 'self' vitals.vercel-insights.com *.google-analytics.com digistats.ch;"
},
{
"key": "Permissions-Policy",
Expand Down