Skip to content

Commit

Permalink
fix: refactor tessen tracking so it includes quickstart attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rudouglas committed Oct 21, 2021
1 parent f7f07dd commit 8136a91
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions src/templates/QuickstartDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ const QuickstartDetails = ({ data, location }) => {
},
];

const viewRepoClick = () =>
tessen.track('instantObservability', 'QuickstartViewRepoClick', {
const trackButtonClick = (action, quickstart) => () =>
tessen.track('instantObservability', action, {
quickstartName: quickstart.name,
quickstartId: quickstart.id,
quickstartUrl: quickstart.packUrl,
});

const tessenTabTrack = (action, quickstart) => (id, count) => {
tessen.track('instantObservability', action, {
QuickstartTabState: id,
Expand Down Expand Up @@ -178,7 +179,10 @@ const QuickstartDetails = ({ data, location }) => {
margin: 1rem 0 0 0;
}
`}
onClick={viewRepoClick}
onClick={trackButtonClick(
'QuickstartViewRepoClick',
quickstart
)}
>
<Icon
name="fe-github"
Expand Down Expand Up @@ -283,32 +287,20 @@ const QuickstartDetails = ({ data, location }) => {
<li>
<Link
to={SIGNUP_LINK}
onClick={() =>
tessen.track(
'instantObservability',
'QuickstartDetailsSignUpClick',
{
quickstartName: quickstart.name,
quickstartId: quickstart.id,
}
)
}
onClick={trackButtonClick(
'QuickstartDetailsSignUpClick',
quickstart
)}
>
Sign Up
</Link>{' '}
for a free New Relic account or{' '}
<Link
to={LOGIN_LINK}
onClick={() =>
tessen.track(
'instantObservability',
'QuickstartDetailsLoginClick',
{
quickstartName: quickstart.name,
quickstartId: quickstart.id,
}
)
}
onClick={trackButtonClick(
'QuickstartDetailsLoginClick',
quickstart
)}
>
Log In
</Link>{' '}
Expand Down

0 comments on commit 8136a91

Please sign in to comment.