Skip to content

Commit ff23cac

Browse files
committed
Add outbound links for google analytics
1 parent ef88c57 commit ff23cac

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/Nav/Nav.component.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react'
22
import { Link } from 'gatsby'
33
import PropTypes from 'prop-types'
4+
import { OutboundLink } from "gatsby-plugin-google-analytics"
45
import {
56
NavWrap,
67
StyledNav,
@@ -67,14 +68,14 @@ const Nav = ({ navOpen, setNavOpen }) => {
6768
<div>
6869
<p>Join the CodeHelp Discord server?</p>
6970
<div>
70-
<a
71+
<OutboundLink
7172
href="https://discord.gg/KntFa9p"
7273
rel="noreferrer noopener"
7374
target="_blank"
7475
title="Join CodeHelp Discord!"
7576
>
7677
Yes
77-
</a>
78+
</OutboundLink>
7879
<button onClick={() => close()} tabIndex="0">
7980
No
8081
</button>

src/pages/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Layout from '../components/Layout'
44
import Seo from '../components/Seo'
55
import { StyledHome } from '../assets/styles/pages/Index.styles'
66
import discordIcon from '../assets/images/icon-discord.svg'
7+
import { OutboundLink } from "gatsby-plugin-google-analytics"
78

89
const IndexPage = () => (
910
<Layout>
@@ -27,7 +28,7 @@ const IndexPage = () => (
2728
fun, helpful group where people can get the development and programming
2829
support they need.
2930
</p>
30-
<a
31+
<OutboundLink
3132
className="button"
3233
href="https://discord.gg/KntFa9p"
3334
rel="noreferrer noopener"
@@ -38,7 +39,7 @@ const IndexPage = () => (
3839
<img alt="Discord Icon" src={discordIcon} />
3940
Join CodeHelp
4041
</span>
41-
</a>
42+
</OutboundLink>
4243
</StyledHome>
4344
</Layout>
4445
)

0 commit comments

Comments
 (0)