Skip to content

Commit

Permalink
Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Koshkin authored and Roman Koshkin committed Apr 17, 2024
1 parent 7cd1a18 commit 1448956
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ $ yarn
$ yarn dev
$ cp .env.example .env.local
```

Edit the `.env.local`: specify the URL, port and password to your Redis database. I'm hosting mine on an [AWS EC2](https://aws.amazon.com/pm/ec2/?gclid=Cj0KCQjwztOwBhD7ARIsAPDKnkBNwCckd88iZw_ImrQtJ6NdJtz0urX3r8iVv5l8Y1pMtaZLswwbYYgaAjWBEALw_wcB&trk=8d7982dd-fe3b-4952-ae11-337e59d552aa&sc_channel=ps&ef_id=Cj0KCQjwztOwBhD7ARIsAPDKnkBNwCckd88iZw_ImrQtJ6NdJtz0urX3r8iVv5l8Y1pMtaZLswwbYYgaAjWBEALw_wcB:G:s&s_kwcid=AL!4422!3!530706572075!e!!g!!aws%20ec2!13705463409!124614255496) micro instance. You can host Redis anywhere, just make sure you can access it.

## Built Using
Expand All @@ -36,6 +37,12 @@ Hosted on [Vercel](https://vercel.com), accelerated by [Cloudflare](https://clou

From the very start to not so long ago my site was just several links to my social media and contacts. Since I started to write about development I decided to have my place where I can write what I want. So, I decided to use Next.js, Tailwind, and MDX as the base for my website.

# Analytics

If you deploy on Vercel, just uncomment the `<Analytics/>` tag in `_app.tsx`. If you want to use Google Analytics, uncomments the `<Script>` tags in `_app.tsx`.

# Credits

This website was built off Pavel Mineev's work. Check out his [GitHub](https://github.com/akellbl4).
This website was built off Pavel Mineev's work. Check out his [GitHub](https://github.com/akellbl4).


Binary file modified public/sharing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"baseUrl": "https://roman-koshkin.unit.oist.jp",
"title": "Roman Koshkin",
"titleSuffix": "- Roman Koshkin",
"description": "Hi, my name is Roman Koshkin and this is my personal website.",
"description": "Bio-inspired AI | NLP | simultaneous machine translation",
"type": "website",
"sharingImageUrl": "/sharing.png",
"twitterAccount": "@akellbl4"
"twitterAccount": "@nightdude4"
}
28 changes: 21 additions & 7 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import React from "react";
import Script from 'next/script'


import Head from 'next/head'
import { SWRConfig } from 'swr'
import type { AppProps } from 'next'
Expand All @@ -7,11 +11,11 @@ import { fetcher } from 'lib/api'
import { composeMeta } from 'lib/meta'
import { Container } from 'components/Container'
import {ThemeProvider} from 'next-themes'
import { Analytics } from "@vercel/analytics/react"

// import { Analytics } from "@vercel/analytics/react"



import React from "react";


export default function MyApp({ Component, pageProps, router }: AppProps) {
Expand Down Expand Up @@ -40,15 +44,25 @@ export default function MyApp({ Component, pageProps, router }: AppProps) {
<link href={meta.canonical} rel="canonical" />
{meta.date && <meta property="article:published_time" content={meta.date} />}
</Head>
{/* <Analytics/> for Vercel*/}
{/* For Google Analytics */}
<Script
src={`https://www.googletagmanager.com/gtag/js?id=${process.env.NEXT_PUBLIC_GTAG_ID}`}
strategy="afterInteractive" // Loads the script after the page becomes interactive
/>
<Script id="google-analytics" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${process.env.NEXT_PUBLIC_GTAG_ID}');
`}
</Script>

<ThemeProvider attribute='class'>
<Container isHome={path === '/'}>
<Component {...pageProps} router={router} />
<Analytics/>
{/* <div className="flex flex-row items-center justify-center mb-10 w-full">
<AnimatedTooltip items={people} />
</div> */}
</Container>

</ThemeProvider>
</SWRConfig>
)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ export default function Home() {
}

Home.meta = {
title: 'Roman Koshkin - Computational Neuroscience, Bio-inspired AI, Deep Learning',
title: 'Bio-inspired AI | NLP | Simultaneous Machine Translation',
overrideTitle: true,
}

0 comments on commit 1448956

Please sign in to comment.