Added analytics

This commit is contained in:
DrMint 2022-08-06 11:31:06 +02:00
parent 70a5cbae91
commit a87d886785
3 changed files with 25 additions and 16 deletions

View File

@ -92,6 +92,8 @@ NEXT_PUBLIC_URL_IMG=https://url-to.img-accords-library.com
NEXT_PUBLIC_URL_WATCH=https://url-to.watch-accords-library.com
NEXT_PUBLIC_URL_SELF=https://url-to-front-accords-library.com
NEXT_PUBLIC_URL_SEARCH=https://url-to.search-accords-library.com
NEXT_PUBLIC_UMAMI_URL=https://url-to.umami-accords-library.com
NEXT_PUBLIC_UMAMI_ID=abcdef0123456789
```
Run in dev mode:

View File

@ -211,34 +211,35 @@ export const AppLayout = ({
<title>{openGraph.title}</title>
<meta name="description" content={openGraph.description} />
<meta name="twitter:title" content={openGraph.title}></meta>
<meta
name="twitter:description"
content={openGraph.description}
></meta>
<meta name="twitter:card" content="summary_large_image"></meta>
<meta name="twitter:image" content={openGraph.thumbnail.image}></meta>
<meta name="twitter:title" content={openGraph.title} />
<meta name="twitter:description" content={openGraph.description} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={openGraph.thumbnail.image} />
<meta property="og:title" content={openGraph.title} />
<meta property="og:description" content={openGraph.description} />
<meta property="og:image" content={openGraph.thumbnail.image}></meta>
<meta property="og:image" content={openGraph.thumbnail.image} />
<meta
property="og:image:secure_url"
content={openGraph.thumbnail.image}
></meta>
/>
<meta
property="og:image:width"
content={openGraph.thumbnail.width.toString()}
></meta>
/>
<meta
property="og:image:height"
content={openGraph.thumbnail.height.toString()}
></meta>
<meta
property="og:image:alt"
content={openGraph.thumbnail.alt}
></meta>
<meta property="og:image:type" content="image/jpeg"></meta>
/>
<meta property="og:image:alt" content={openGraph.thumbnail.alt} />
<meta property="og:image:type" content="image/jpeg" />
<script
async
defer
data-website-id={process.env.NEXT_PUBLIC_UMAMI_ID}
src={`${process.env.NEXT_PUBLIC_UMAMI_URL}/umami.js`}
/>
</Head>
{/* Background when navbar is opened */}

View File

@ -190,6 +190,9 @@ const Revalidate = (
paths.push(`/library/${body.entry.library_item.slug}`);
paths.push(`/library/${body.entry.library_item.slug}/scans`);
}
if (body.entry.content) {
paths.push(`/contents/${body.entry.content.slug}`);
}
serverRuntimeConfig.locales?.map((locale: string) => {
if (body.entry.library_item) {
paths.push(`/${locale}/library/${body.entry.library_item.slug}`);
@ -197,6 +200,9 @@ const Revalidate = (
`/${locale}/library/${body.entry.library_item.slug}/scans`
);
}
if (body.entry.content) {
paths.push(`/${locale}/contents/${body.entry.content.slug}`);
}
});
break;
}