Skip to content

Commit

Permalink
remove countly metrics dependency (#124)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Huseby <[email protected]>
  • Loading branch information
dhuseby authored May 1, 2024
1 parent 57f1b22 commit c09da83
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 290 deletions.
14 changes: 1 addition & 13 deletions src/.vuepress/theme/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
:key="'link-' + index"
class="sm:mr-10 last:mr-0"
:class="[{ 'mb-4': item.children && item.children.length }]"
@click="onlinkClick(item)"
>
<NavLink
:item="item"
Expand All @@ -26,7 +25,6 @@
v-for="(childItem, childIndex) in item.children"
:key="'link-child' + childIndex"
class="mb-2 last:mb-0"
@click="onlinkClick(item)"
>
<NavLink
:item="childItem"
Expand All @@ -50,8 +48,6 @@ import SocialLinks from '@theme/components/SocialLinks'
import FooterLegal from '@theme/components/FooterLegal'
import NavLink from '@theme/components/NavLink.vue'
import countly from '../util/countly'
export default {
name: 'Footer',
components: { SocialLinks, NavLink, FooterLegal },
Expand All @@ -60,15 +56,7 @@ export default {
return this.$themeLocaleConfig.footerLinks
},
},
methods: {
onlinkClick(item) {
countly.trackEvent(countly.events.LINK_CLICK_FOOTER, {
path: this.$route.path,
text: item.text,
href: item.link,
})
},
},
methods: {},
}
</script>

Expand Down
27 changes: 1 addition & 26 deletions src/.vuepress/theme/components/FooterLegal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
href="https://protocol.ai"
target="_blank"
class="mr-1 inline-block align-middle"
@click="(event) => onLinkClick(event, true)"
>
<SVGIcon
name="logo-icon"
Expand All @@ -18,46 +17,40 @@
class="text-blueGreenLight hover:underline"
href="https://protocol.ai"
target="_blank"
@click="onLinkClick"
>Protocol Labs</a
>
| Except as
<a
class="text-blueGreenLight hover:underline"
href="https://protocol.ai/legal/"
target="_blank"
@click="onLinkClick"
>noted</a
>, content licensed
<a
class="text-blueGreenLight hover:underline"
href="https://creativecommons.org/licenses/by/3.0/"
target="_blank"
@click="onLinkClick"
>CC-BY 3.0</a
>
|
<a
class="text-blueGreenLight hover:underline"
href="https://protocol.ai/legal/#terms-of-service"
target="_blank"
@click="onLinkClick"
>Terms</a
>
|
<a
class="text-blueGreenLight hover:underline"
href="https://protocol.ai/legal/#privacy-policy"
target="_blank"
@click="onLinkClick"
>Privacy</a
>
|
<a
class="text-blueGreenLight hover:underline"
href="https://ipfs.tech/legal/"
target="_blank"
@click="onLinkClick"
>DMCA</a
></span
>
Expand All @@ -67,27 +60,9 @@
<script>
import SVGIcon from '@theme/components/base/SVGIcon.vue'
import countly from '../util/countly'
export default {
name: 'FooterLegal',
components: { SVGIcon },
methods: {
onLinkClick(event, isSvg) {
const href = isSvg
? event.srcElement.parentElement.href
: event.srcElement.href
const text = isSvg
? event.srcElement.firstChild.textContent
: event.srcElement.text
countly.trackEvent(countly.events.LINK_CLICK_FOOTER, {
view: this.$route.path,
text: text.trim(),
href: href,
})
},
},
methods: { },
}
</script>
10 changes: 0 additions & 10 deletions src/.vuepress/theme/components/MobileNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<Link
class="mobile-nav__link type-h1"
:item="page"
:on-click="onClickNavLink"
/>
</li>
</ul>
Expand All @@ -37,8 +36,6 @@ import SocialLinks from '@theme/components/SocialLinks'
import Link from '@theme/components/base/Link'
import trapFocus from '@theme/util/trapFocus'
import countly from '../util/countly'
export default {
name: 'MobileNav',
components: {
Expand Down Expand Up @@ -89,13 +86,6 @@ export default {
afterEnter() {
this.setTabItems()
},
onClickNavLink(item) {
countly.trackEvent(countly.events.LINK_CLICK_NAV, {
view: this.$route.path,
href: item.link,
text: item.text,
})
},
},
}
</script>
Expand Down
10 changes: 0 additions & 10 deletions src/.vuepress/theme/components/Nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<Link
class="nav__link font-display font-medium"
:item="page"
:on-click="onClickNavLink"
/>
</li>
</ul>
Expand All @@ -57,8 +56,6 @@ import { mapState } from 'vuex'
import SVGIcon from '@theme/components/base/SVGIcon'
import Link from '@theme/components/base/Link'
import countly from '../util/countly'
export default {
name: 'Nav',
components: {
Expand Down Expand Up @@ -137,13 +134,6 @@ export default {
toggleMobileMenu() {
this.$store.commit('appState/toggleMobileNav', !this.mobileNavActive)
},
onClickNavLink(item) {
countly.trackEvent(countly.events.LINK_CLICK_NAV, {
view: this.$route.path,
href: item.link,
text: item.text,
})
},
},
}
</script>
Expand Down
13 changes: 1 addition & 12 deletions src/.vuepress/theme/components/SocialLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
:href="link.link"
target="_blank"
rel="noopener noreferrer"
@click="socialLinkClick(link)"
>
<SVGIcon
class="w-8 h-8 fill-current hover:opacity-75 transition transition-opacity duration-300 ease-in-out"
Expand All @@ -20,8 +19,6 @@
<script>
import SVGIcon from '@theme/components/base/SVGIcon'
import countly from '../util/countly'
export default {
name: 'SocialLinks',
components: { SVGIcon },
Expand All @@ -30,14 +27,6 @@ export default {
return this.$themeLocaleConfig.socialLinks
},
},
methods: {
socialLinkClick(link) {
countly.trackEvent(countly.events.SOCIAL_MEDIA_OUTBOUNDS, {
view: this.$route.path,
text: link.text,
link: link.link,
})
},
},
methods: {},
}
</script>
11 changes: 1 addition & 10 deletions src/.vuepress/theme/components/blog/LinksAndSocial.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script>
import RSSSubscription from '@theme/components/RSSSubscription.vue'
import countly from '../../util/countly'
export default {
name: 'LinksAndSocial',
components: {
Expand All @@ -15,13 +13,6 @@ export default {
},
},
computed: {},
methods: {
trackSubmitItem() {
countly.trackEvent(countly.events.LINK_CLICK_SUBMIT_ITEM)
},
trackPressKit() {
countly.trackEvent(countly.events.LINK_CLICK_PRESS_KIT)
},
},
methods: {},
}
</script>
8 changes: 1 addition & 7 deletions src/.vuepress/theme/components/blog/NewsletterForm.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script>
import { mapState } from 'vuex'
import countly from '../../util/countly'
export default {
name: 'NewsletterForm',
props: {},
Expand All @@ -12,10 +10,6 @@ export default {
computed: {
...mapState('appState', ['latestWeeklyPost']),
},
methods: {
subscribeClick() {
countly.trackEvent(countly.events.NEWSLETTER_SUBSCRIBE)
},
},
methods: {},
}
</script>
8 changes: 0 additions & 8 deletions src/.vuepress/theme/components/blog/PostAuthor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

<script>
import { mapState } from 'vuex'
import countly from '../../util/countly'
export default {
name: 'PostAuthor',
Expand Down Expand Up @@ -57,13 +56,6 @@ export default {
},
methods: {
handleAuthorClick(author) {
const authorTracking = {
author: author.name,
method: `${this.parent}-select`,
}
countly.trackEvent(countly.events.FILTER, authorTracking)
this.$store.commit('appState/setActiveAuthor', author)
},
},
Expand Down
8 changes: 0 additions & 8 deletions src/.vuepress/theme/components/blog/PostMeta.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import PostTag from '@theme/components/blog/PostTag'
import PostAuthor from '@theme/components/blog/PostAuthor'
import PostMetaTitle from '@theme/components/blog/PostMetaTitle'
import UnstyledLink from '@theme/components/UnstyledLink'
import countly from '../../util/countly'
export default {
name: 'PostMeta',
Expand Down Expand Up @@ -113,13 +112,6 @@ export default {
},
methods: {
handleCatClick() {
const categoryTracking = {
category: this.category.name,
method: 'card-select',
}
countly.trackEvent(countly.events.FILTER, categoryTracking)
this.$store.commit('appState/setActiveCategory', this.category)
},
},
Expand Down
12 changes: 1 addition & 11 deletions src/.vuepress/theme/components/blog/PostSocials.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
hashtags=""
:twitter-user="social.twitterHandle"
class="mr-1 last:mr-0"
@open="shareClick(social)"
>
<SVGIcon
class="w-6 h-6 opacity-50 fill-current text-blueGreen hover:opacity-100 transition transition-opacity duration-300 ease-in-out"
Expand All @@ -24,8 +23,6 @@
<script>
import SVGIcon from '@theme/components/base/SVGIcon'
import countly from '../../util/countly'
export default {
name: 'PostSocials',
components: { SVGIcon },
Expand Down Expand Up @@ -60,13 +57,6 @@ export default {
this.currentUrl = window.location.href
this.host = window.location.host
},
methods: {
shareClick(social) {
countly.trackEvent(countly.events.SOCIAL_MEDIA_SHARE, {
view: this.$route.path,
text: social.text,
})
},
},
methods: {},
}
</script>
25 changes: 2 additions & 23 deletions src/.vuepress/theme/components/blog/PostTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@
:to="{ path: $localePath, query: { tags: tag.slug } }"
:class="computedClass"
rel="nofollow"
@click.native="handleTagClick"
>
#{{ tag.name }}
</router-link>
<button v-else :class="computedClass" @click="addNewTag">
<button v-else :class="computedClass">
#{{ tag.name }}
</button>
</template>

<script>
import countly from '../../util/countly'
export default {
name: 'PostTag',
props: {
Expand Down Expand Up @@ -55,24 +52,6 @@ export default {
]
},
},
methods: {
handleTagClick() {
this.trackTag()
this.$store.commit('appState/setActiveTags', [this.tag.slug])
},
addNewTag() {
this.trackTag()
this.$store.commit('appState/addNewTag', [this.tag.slug])
this.callback()
},
trackTag() {
const tagTracking = {
tag: this.tag.name,
method: `${this.parent}-select`,
}
countly.trackEvent(countly.events.FILTER, tagTracking)
},
},
methods: {},
}
</script>
Loading

0 comments on commit c09da83

Please sign in to comment.