Skip to content

Commit 4852e40

Browse files
committed
add analytics
1 parent c37f38f commit 4852e40

2 files changed

Lines changed: 19 additions & 20 deletions

File tree

data/siteMetadata.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ const siteMetadata = {
2222
// If you want to use an analytics provider you have to add it to the
2323
// content security policy in the `next.config.js` file.
2424
// supports Plausible, Simple Analytics, Umami, Posthog or Google Analytics.
25-
umamiAnalytics: {
26-
// We use an env variable for this site to avoid other users cloning our analytics ID
27-
umamiWebsiteId: process.env.NEXT_UMAMI_ID, // e.g. 123e4567-e89b-12d3-a456-426614174000
28-
// You may also need to overwrite the script if you're storing data in the US - ex:
29-
// src: 'https://us.umami.is/script.js'
30-
// Remember to add 'us.umami.is' in `next.config.js` as a permitted domain for the CSP
31-
},
25+
// umamiAnalytics: {
26+
// // We use an env variable for this site to avoid other users cloning our analytics ID
27+
// umamiWebsiteId: process.env.NEXT_UMAMI_ID, // e.g. 123e4567-e89b-12d3-a456-426614174000
28+
// // You may also need to overwrite the script if you're storing data in the US - ex:
29+
// // src: 'https://us.umami.is/script.js'
30+
// // Remember to add 'us.umami.is' in `next.config.js` as a permitted domain for the CSP
31+
// },
3232
// plausibleAnalytics: {
3333
// plausibleDataDomain: '', // e.g. tailwind-nextjs-starter-blog.vercel.app
3434
// If you are hosting your own Plausible.
@@ -38,9 +38,9 @@ const siteMetadata = {
3838
// posthogAnalytics: {
3939
// posthogProjectApiKey: '', // e.g. 123e4567-e89b-12d3-a456-426614174000
4040
// },
41-
// googleAnalytics: {
42-
// googleAnalyticsId: '', // e.g. G-XXXXXXX
43-
// },
41+
googleAnalytics: {
42+
googleAnalyticsId: 'G-DQW4JD37F8', // e.g. G-XXXXXXX
43+
},
4444
},
4545
newsletter: {
4646
// supports mailchimp, buttondown, convertkit, klaviyo, revue, emailoctopus, beehive
@@ -82,14 +82,14 @@ const siteMetadata = {
8282
// kbarConfig: {
8383
// searchDocumentsPath: `${process.env.BASE_PATH || ''}/search.json`, // path to load documents to search
8484
// },
85-
// provider: 'algolia',
86-
// algoliaConfig: {
87-
// // The application ID provided by Algolia
88-
// appId: 'R2IYF7ETH7',
89-
// // Public API key: it is safe to commit it
90-
// apiKey: '599cec31baffa4868cae4e79f180729b',
91-
// indexName: 'docsearch',
92-
// },
85+
// provider: 'algolia',
86+
// algoliaConfig: {
87+
// // The application ID provided by Algolia
88+
// appId: 'R2IYF7ETH7',
89+
// // Public API key: it is safe to commit it
90+
// apiKey: '599cec31baffa4868cae4e79f180729b',
91+
// indexName: 'docsearch',
92+
// },
9393
// },
9494
}
9595

next.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
77
// You might need to insert additional domains in script-src if you are using external services
88
const ContentSecurityPolicy = `
99
default-src 'self';
10-
script-src 'self' 'unsafe-eval' 'unsafe-inline' giscus.app analytics.umami.is;
11-
style-src 'self' 'unsafe-inline';
10+
script-src 'self' 'unsafe-eval' 'unsafe-inline' giscus.app analytics.umami.is www.googletagmanager.com www.google-analytics.com; style-src 'self' 'unsafe-inline';
1211
img-src * blob: data:;
1312
media-src *.s3.amazonaws.com;
1413
connect-src *;

0 commit comments

Comments
 (0)