Skip to content

Commit 4f22084

Browse files
committed
📈 (Course CTA Tracking) Add plausible event tracking in BottomCallout component
This will allow us to track when and where (and how often) the Course CTAs are getting clicked.
1 parent 879184b commit 4f22084

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

‎curriculum/.vuepress/components/BottomCallout.vue‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
<script>
2+
window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }
23
export default {
3-
props: ['title', 'subtitle']
4+
props: ['title', 'subtitle'],
5+
methods: {
6+
plausibleEvent: function(eventName, props) {
7+
if (props) {
8+
props['path'] = window.location.pathname;
9+
} else {
10+
props = {
11+
path: window.location.pathname
12+
}
13+
}
14+
window.plausible(eventName, props);
15+
}
16+
}
417
}
518
</script>
619

@@ -76,7 +89,7 @@ export default {
7689
</li>
7790
</ul>
7891
<p class="bottom-callout__text">
79-
<a href="https://go.tecla.do/web-dev-course-sale" class="bottom-callout__link">
92+
<a v-on:click="plausibleEvent('Course CTA Clicked')" href="https://go.tecla.do/web-dev-course-sale" class="bottom-callout__link">
8093
Get the video course <svg class="bottom-callout__feature-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g transform="matrix(1,0,0,1,0,0)"><path d="M10.5,9.121h6V6.011c0-.272.163-.343.362-.158L23,11.54a.751.751,0,0,1-.017,1.142l-6.116,5.336c-.2.185-.362.114-.362-.157v-2.74h-6" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7.5 9.121L5.25 9.121" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 9.121L0.75 9.121" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M7.5 15.121L5.25 15.121" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path><path d="M3 15.121L0.75 15.121" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></path></g></svg>
8194
</a>
8295
</p>

0 commit comments

Comments
 (0)