Skip to content

Commit

Permalink
Merge pull request #317 from kiva/wwwHeader-track-events
Browse files Browse the repository at this point in the history
feat: add tracking events
  • Loading branch information
christian14b authored Nov 20, 2023
2 parents c7bb125 + 03f71c5 commit 4f1e065
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions @kiva/kv-components/vue/KvWwwHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
</transition>
<!-- logo -->
<a
v-kv-track-event="['TopNav', 'click-Logo']"
href="/"
class="
tw-px-1 tw-py-2
Expand Down
7 changes: 7 additions & 0 deletions @kiva/kv-components/vue/KvWwwHeader/KvHeaderLinkBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<!-- lend -->
<a
ref="lendButton"
v-kv-track-event="['TopNav', 'click-Lend']"
href="/lend-by-category"
class="
tw-px-1.5 tw-py-1 tw-mx-1
Expand Down Expand Up @@ -88,6 +89,7 @@
<a
v-if="basketCount > 0"
ref="basketLink"
v-kv-track-event="['TopNav', 'click-Basket']"
href="/basket"
class="header-link tw-relative"
:class="{'tw-text-tertiary': !!openMenuItem}"
Expand All @@ -100,6 +102,7 @@
<!-- search icon -->
<button
ref="searchButton"
v-kv-track-event="['TopNav', 'click-Search-toggle']"
class="header-link"
:class="{
'tw-text-tertiary': !!openMenuItem
Expand All @@ -112,6 +115,7 @@
<a
v-if="!loggedIn"
ref="signInLink"
v-kv-track-event="['TopNav', 'click-Sign-in']"
:href="loginUrl"
class="header-link tw-hidden lg:tw-block"
:class="{'tw-text-tertiary': !!openMenuItem}"
Expand All @@ -121,6 +125,9 @@
<!-- 3-bar menu (sm) -->
<button
ref="menuButton"
v-kv-track-event="openMenuItem === KvHeaderMobileMenu
? ['TopNav', 'click-Hamburger-menu']
: null"
class="header-link tw-inline-flex lg:tw-hidden"
:class="{
'tw-text-tertiary': openMenuItem && openMenuItem !== KvHeaderMobileMenu
Expand Down
5 changes: 5 additions & 0 deletions @kiva/kv-components/vue/KvWwwHeader/KvHeaderMobileMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,32 @@
<nav class="tw--mt-0.5 tw-pb-0.5 tw-flex tw-flex-col tw-items-end lg:tw-hidden tw-font-medium">
<kv-header-menu-link
v-if="!loggedIn"
v-kv-track-event="['TopNav', 'click-menu-Sign-in']"
:href="loginUrl"
>
Sign in
</kv-header-menu-link>
<kv-header-menu-link
v-kv-track-event="['TopNav', 'click-menu-Support-kiva']"
href="/donate/supportus"
>
Support Kiva
</kv-header-menu-link>
<kv-header-menu-link
v-if="!loggedIn"
v-kv-track-event="['TopNav', 'click-menu-Borrow']"
href="/borrow"
>
Borrow
</kv-header-menu-link>
<kv-header-menu-link
v-kv-track-event="['TopNav', 'click-menu-About-us']"
href="/about"
>
About us
</kv-header-menu-link>
<kv-header-menu-link
v-kv-track-event="['TopNav', 'click-menu-Partner-with-us']"
href="/about/partner-with-us"
>
Partner with us
Expand Down
1 change: 1 addition & 0 deletions @kiva/kv-components/vue/KvWwwHeader/KvHeaderSearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</div>
<!-- cancel search -->
<button
v-kv-track-event="['TopNav', 'click-cancel-search']"
class="tw-px-2.5 tw-transition-opacity"
:class="{
'tw-opacity-full tw-duration-300': searchExitVisible,
Expand Down

0 comments on commit 4f1e065

Please sign in to comment.