Skip to content

Commit

Permalink
#16 add analytics to website
Browse files Browse the repository at this point in the history
  • Loading branch information
chraebsli authored Oct 8, 2023
1 parent 0620606 commit 04e438b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 45 deletions.
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.12.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 @@ -12,11 +12,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 @@ -26,6 +24,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

1 comment on commit 04e438b

@vercel
Copy link

@vercel vercel bot commented on 04e438b Oct 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.