Skip to content

Commit

Permalink
📈 Set ll_medium for internal button
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Nov 7, 2024
1 parent 8a3602f commit cd74c31
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@
<div class="grid grid-flow-row gap-y-[16px]">
<NuxtLink
class="hover:underline"
:to="localeLocation({ name: 'store' })"
:to="
localeLocation({
name: 'store',
query: {
ll_medium: 'footer',
},
})
"
@click.native="handleClickButton('store_books')"
>
{{ $t('footer_nav_store_books') }}
Expand Down
4 changes: 4 additions & 0 deletions src/components/NFTBook/ItemCardV2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ export default {
type: Boolean,
default: true,
},
linkMedium: {
type: String,
default: '',
},
},
data() {
return {
Expand Down
7 changes: 6 additions & 1 deletion src/components/SiteHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
</NuxtLink>

<ButtonV2
:to="localeLocation({ name: 'store' })"
:to="
localeLocation({
name: 'store',
ll_medium: 'header_store_button',
})
"
preset="tertiary"
size="mini"
:text="$t('header_button_try_collect')"
Expand Down
6 changes: 6 additions & 0 deletions src/mixins/nft-or-collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,18 @@ export default {
params: {
collectionId: this.collectionId,
},
query: {
ll_medium: this.linkMedium,
},
})
: this.localeLocation({
name: 'nft-class-classId',
params: {
classId: this.classId,
},
query: {
ll_medium: this.linkMedium,
},
});
},
},
Expand Down
7 changes: 6 additions & 1 deletion src/mixins/utm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ export default {
return {
utmCampaign: this.$route.query.utm_campaign,
utmSource: this.$route.query.utm_source,
utmMedium: this.$route.query.utm_medium,
utmMedium: this.$route.query.utm_medium || this.linkMedium,
documentReferrer: '',
fbClickId: this.formattedFbcQs,
};
},
computed: {
linkMedium() {
return this.$route.query.ll_medium;
},
gadClickId() {
return this.$route.query.gclid;
},
Expand All @@ -33,6 +36,8 @@ export default {
this.restoreUTMFromSessionStorage();
this.storeUTMToSessionStorage();
this.getFbClickIdFromCookie();
// TODO: split linkMedium into a new separate field
this.utmMedium = this.utmMedium || this.linkMedium;
},
methods: {
setUTMProps({ utmCampaign, utmSource, utmMedium }) {
Expand Down
7 changes: 6 additions & 1 deletion src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@
:cover-resize="300"
:is-link-disabled="stickyBookstoreItem.isMultiple"
:is-lazy-loaded="false"
link-medium="index_sticky_item"
@click-cover="handleClickItem($event, stickyBookstoreItem)"
/>
</div>
Expand All @@ -421,6 +422,7 @@
class-cover-frame-aspect-ratio="min-h-[360px] laptop:min-h-[0] aspect-[4/5]"
:cover-resize="300"
:is-link-disabled="item.isMultiple"
link-medium="index_grid_item"
@click-cover="handleClickItem($event, item)"
/>
</li>
Expand Down Expand Up @@ -452,6 +454,7 @@
<NFTBookItemCardV2
:item-id="item.classId"
class-cover-frame-aspect-ratio="aspect-[4/5]"
link-medium="index_grid_item_swiper"
@click-cover="handleClickItem($event, item)"
/>
</SwiperSlide>
Expand Down Expand Up @@ -571,7 +574,9 @@
name: 'store',
query: {
tag: 'autograph',
utm_source: 'landing_page_signature_banner_cta',
utm_medium:
$route.query.utm_medium ||
'landing_page_signature_banner_cta',
},
})
"
Expand Down
16 changes: 16 additions & 0 deletions src/pages/store/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
:item-id="item.classId"
class-cover-frame-aspect-ratio="aspect-[4/5]"
:is-link-disabled="item.isMultiple"
:link-medium="linkMedium"
@click-cover="handleClickItem($event, item)"
/>
</li>
Expand Down Expand Up @@ -706,6 +707,21 @@ export default {
}
return baseUrl;
},
linkMedium() {
const {
query: { ll_medium: qsMedium, tag, q },
} = this.$route;
if (qsMedium) {
return qsMedium;
}
if (tag) {
return `tag-${tag}`;
}
if (q) {
return 'search';
}
return 'listing';
},
// Price filter related
priceFilterList() {
return [
Expand Down

0 comments on commit cd74c31

Please sign in to comment.