Skip to content

Commit 297e56b

Browse files
committed
added tracking on post.js
1 parent 9318c3b commit 297e56b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/constants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ const backendTechStack = [
124124
},
125125
]
126126

127-
const track = name => {
128-
mixpanel.track(name)
127+
const track = (name, props) => {
128+
mixpanel.track(name, props)
129129
}
130130
const filterByPart = (array, path) => {
131131
const result = array

src/templates/post.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ import ArrowRight from "../assets/arrow-right.svg"
88
import SideChapterBox from "../components/chapters/SideChapterBox"
99
import GithubButton from "../components/buttons/GithubButtton"
1010
import SEO from "../components/seo"
11+
import constants from "../constants"
1112
export default function Template({ data, pageContext }) {
1213
const { markdownRemark } = data // data.markdownRemark holds your post data
1314
const { frontmatter, html } = markdownRemark
1415
const { previous, next } = pageContext
16+
constants.track("App.Post.View", {
17+
postName: frontmatter.title,
18+
})
1519
return (
1620
<Layout>
1721
<SEO

0 commit comments

Comments
 (0)