Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove plausible and custom event tracking #328

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/blocks/hero.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import Slogan from '$components/slogan.svelte';
import { drawerLinks } from '$lib/actions/drawer-links';
import { VIDEO_EXTENSIONS } from '$lib/constants';
import { TrackingEvent } from '$lib/track';
import { getImageAttributes } from '$lib/utils/cms';
import { getFileExtension } from '$lib/utils/strings';

Expand Down Expand Up @@ -51,7 +50,6 @@
? getImageAttributes(block.showreel_cover).src
: undefined}
buttonTheme={block.showreel_button_theme}
trackEvent={{ event: TrackingEvent.HOME_REEL }}
/>
{/if}
</div>
Expand Down
17 changes: 1 addition & 16 deletions src/components/blocks/rich-text-box.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
import { storyblokEditable } from '$lib/actions/storyblok-editable';
import { TrackingEvent, track } from '$lib/track';
import { getAnchorFromCmsLink, getImageAttributes } from '$lib/utils/cms';
import type { RichtextBoxStoryblok } from '$types/bloks';
import { Button } from '@significa/svelte-ui';
Expand Down Expand Up @@ -39,20 +37,7 @@
{#each block.link as { label, link }}
{@const { href } = getAnchorFromCmsLink(link)}
<div class="mt-4">
<Button
as="a"
{href}
on:click={() => {
track(TrackingEvent.CTA_CLICK, {
props: {
to: href,
path: $page.url.pathname
}
});
}}
variant="secondary"
arrow>{label}</Button
>
<Button as="a" {href} variant="secondary" arrow>{label}</Button>
</div>
{/each}
{/if}
Expand Down
20 changes: 1 addition & 19 deletions src/components/blocks/testimonials.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
import clsx from 'clsx';
import People from '../illustrations/stickers/people.svelte';
import FriedEgg from '../illustrations/stickers/fried-egg.svelte';
import { TrackingEvent, track } from '$lib/track';
import { page } from '$app/stores';
import { drawer } from '$lib/stores/drawer';

export let block: TestimonialsStoryblok;

Expand Down Expand Up @@ -39,22 +36,7 @@
{/if}
{#if block.testimonials_cta_link}
{@const { href } = getAnchorFromCmsLink(block.testimonials_cta_link)}
<Button
as="a"
{href}
on:click={() => {
track(TrackingEvent.CTA_CLICK, {
props: {
to: href,
path: $drawer || $page.url.pathname,
section: block.testimonials_title1
}
});
}}
arrow
size="md"
class="mx-auto mt-6"
>
<Button as="a" {href} arrow size="md" class="mx-auto mt-6">
{block.testimonials_cta_label}
</Button>
{/if}
Expand Down
27 changes: 2 additions & 25 deletions src/components/blog-entry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
import { Button, Link, Tag } from '@significa/svelte-ui';
import type { ISbStoryData } from '@storyblok/js';
import Person from './person.svelte';
import { TrackingEvent, track } from '$lib/track';
import { page } from '$app/stores';
import { drawer } from '$lib/stores/drawer';
import { t } from '$lib/i18n';
import { twMerge } from 'tailwind-merge';

Expand Down Expand Up @@ -42,31 +39,11 @@
<p class="mb-2 text-base font-medium text-foreground-secondary">
{formatDate(new Date(post.first_published_at || post.published_at || post.created_at))}
</p>
<Link
href={`/blog/${post.slug}`}
on:click={() => {
track(TrackingEvent.BLOG_POST_CLICK, {
props: {
name: post.name,
to: `/blog/${post.slug}`,
path: $drawer || $page.url.pathname
}
});
}}
class="max-w-2xl text-4xl elevated-link">{post.name}</Link
>
<Link href={`/blog/${post.slug}`} class="max-w-2xl text-4xl elevated-link">{post.name}</Link>
{#if post.tag_list.length}
<div class="mt-5 flex flex-wrap gap-2">
{#each post.tag_list as tag}
<Tag
href="/blog?t={encodeURIComponent(tag)}"
on:click={() => {
track(TrackingEvent.BLOG_POST_TAG_CLICK, {
props: { name: tag, path: $drawer || $page.url.pathname }
});
}}
label={tag}
/>
<Tag href="/blog?t={encodeURIComponent(tag)}" label={tag} />
{/each}
</div>
{/if}
Expand Down
10 changes: 2 additions & 8 deletions src/components/contact-form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import { page } from '$app/stores';
import { drawerLinks } from '$lib/actions/drawer-links';
import { t } from '$lib/i18n';
import { TrackingEvent, track } from '$lib/track';
import {
type FileUploadItem,
Button,
Expand Down Expand Up @@ -116,7 +115,6 @@
let loading = false;

$: if ($page.form?.success) {
track(TrackingEvent.FORM_SUBMISSION, { props: { path: $page.url.pathname, type } });
dispatch('success');
toast.success({
message: t('contact.feedback.success.title'),
Expand Down Expand Up @@ -335,12 +333,8 @@
>
<div class="text-sm">
<p class="leading-none text-foreground-secondary">{t('contact.footer.title')}</p>
<Link
class="mt-0.5 inline-flex"
href="mailto:{t('contact.footer.email')}"
on:click={() => {
track(TrackingEvent.FORM_CHOOSE_MAILTO, { props: { path: $page.url.pathname } });
}}>{t('contact.footer.email')}</Link
<Link class="mt-0.5 inline-flex" href="mailto:{t('contact.footer.email')}"
>{t('contact.footer.email')}</Link
>
</div>
</div>
Expand Down
9 changes: 0 additions & 9 deletions src/components/draw-your-segg/canvas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import { page } from '$app/stores';
import { toast } from '@significa/svelte-ui';
import { t } from '$lib/i18n';
import { TrackingEvent, track } from '$lib/track';

const dispatch = createEventDispatcher<{ change: Drawing }>();

Expand Down Expand Up @@ -157,10 +156,6 @@
['undo', undo, canUndo, undoImage],
['redo', redo, canRedo, redoImage]
] as const;

$: if (started) {
track(TrackingEvent.DRAW_YOUR_SEGG_INTERACT);
}
</script>

<div data-theme="light" class="relative select-none overflow-hidden">
Expand Down Expand Up @@ -217,7 +212,6 @@
toast.success({
message: t('draw-segg.clipboard.feedback')
});
track(TrackingEvent.DRAW_YOUR_SEGG_COPY);
}}
>
<img alt="copy link" src={linkImage} />
Expand All @@ -227,9 +221,6 @@
<a
class="flex h-8 w-8 items-center justify-center rounded-sm border hover:bg-foreground/2"
download="segg.png"
on:click={() => {
track(TrackingEvent.DRAW_YOUR_SEGG_DOWNLOAD);
}}
href={canvas?.toDataURL('image/png')}><img alt="download" src={saveImage} /></a
>
{/key}
Expand Down
8 changes: 0 additions & 8 deletions src/components/page-drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import { page } from '$app/stores';
import { fetchPage } from '$lib/content';
import { setContext } from 'svelte';
import { TrackingEvent, track } from '$lib/track';

let expanding = false;

Expand Down Expand Up @@ -42,13 +41,6 @@
variant="ghost"
icon="expand"
on:click={() => {
if ($drawer) {
track(TrackingEvent.DRAWER_EXPAND, {
props: {
to: $drawer
}
});
}
expanding = true;
}}>{t('expand')}</Button
>
Expand Down
20 changes: 1 addition & 19 deletions src/components/pages/about/timeline.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { distanceToTop } from '$lib/actions/distance-to-top';
import { storyblokEditable } from '$lib/actions/storyblok-editable';
import { TrackingEvent, track } from '$lib/track';
import { getAnchorFromCmsLink, getImageAttributes } from '$lib/utils/cms';
import type { AboutPageStoryblok, TimelineArrowStoryblok } from '$types/bloks';
import { Button } from '@significa/svelte-ui';
Expand Down Expand Up @@ -120,23 +118,7 @@
<p class="font-comic text-sm font-bold">{item.text}</p>
{#if item.link?.[0]}
{@const { href, target, rel } = getAnchorFromCmsLink(item.link[0].link)}
<Button
size="sm"
as="a"
{href}
{rel}
{target}
on:click={() => {
track(TrackingEvent.CTA_CLICK, {
props: {
to: href,
path: $page.url.pathname,
section: 'Timeline'
}
});
}}
class="pointer-events-auto mt-4"
>
<Button size="sm" as="a" {href} {rel} {target} class="pointer-events-auto mt-4">
{item.link[0].label}
</Button>
{/if}
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/blog-index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import Seo from '$components/seo.svelte';
import { BLOG_PARAMS } from '$lib/content';
import { t } from '$lib/i18n';
import { TrackingEvent, track } from '$lib/track';
import { getStoryblok } from '$lib/storyblok';
import type { BlogPostStoryblok } from '$types/bloks';
import { Button } from '@significa/svelte-ui';
Expand Down Expand Up @@ -87,7 +86,6 @@
variant="secondary"
on:click={() => {
fetchStories($posts.length / BLOG_PARAMS.per_page + 1);
track(TrackingEvent.BLOG_INDEX_LOAD_MORE);
}}
loading={$isFetching}
>
Expand Down
38 changes: 4 additions & 34 deletions src/components/pages/blog-post.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
import TwoEggs from '$components/illustrations/two-eggs.svelte';
import Seo from '$components/seo.svelte';
import type { BlogPostPage } from '$lib/content';
import { TrackingEvent, track } from '$lib/track';
import { page } from '$app/stores';
import { drawer } from '$lib/stores/drawer';

export let story: BlogPostPage;
export let related: BlogPostPage[];
Expand All @@ -37,15 +34,7 @@
{#if story.tag_list.length}
<div class="mt-5 flex flex-wrap gap-2">
{#each story.tag_list as tag}
<Tag
href="/blog?t={encodeURIComponent(tag)}"
on:click={() => {
track(TrackingEvent.BLOG_POST_TAG_CLICK, {
props: { name: tag, path: $drawer || $page.url.pathname }
});
}}
label={tag}
/>
<Tag href="/blog?t={encodeURIComponent(tag)}" label={tag} />
{/each}
</div>
{/if}
Expand Down Expand Up @@ -83,17 +72,7 @@
position={author.content.position}
photo={author.content.photo}
/>
<Button
variant="secondary"
as="a"
href={`/about/${author.slug}`}
on:click={() =>
track(TrackingEvent.BLOG_POST_AUTHOR_PAGE_CLICK, {
props: { path: $drawer || $page.url.pathname, to: `/about/${author.slug}` }
})}
arrow
icon="document"
>
<Button variant="secondary" as="a" href={`/about/${author.slug}`} arrow icon="document">
{t('author-page')}
</Button>
</div>
Expand All @@ -111,17 +90,8 @@
<div class="flex-1">
<h4 class="max-w-md text-3xl font-bold">{t('blog.pre-footer.title')}</h4>
</div>
<Button
class="mt-6"
as="a"
href="/get-a-quote"
on:click={() => {
track(TrackingEvent.GET_A_QUOTE_LINK, {
props: { path: $drawer || $page.url.pathname, context: 'blog post' }
});
}}
arrow
icon="document">{t('blog.pre-footer.cta')}</Button
<Button class="mt-6" as="a" href="/get-a-quote" arrow icon="document"
>{t('blog.pre-footer.cta')}</Button
>
</div>
<TwoEggs class="hidden w-60 sm:block" />
Expand Down
21 changes: 3 additions & 18 deletions src/components/pages/careers.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import type { TeamMemberPage } from '$lib/content';
import DrawYourSegg from '$components/draw-your-segg/draw-your-segg.svelte';
import { getImageAttributes } from '$lib/utils/cms';
import { TrackingEvent, track } from '$lib/track';
import { drawerLinks } from '$lib/actions/drawer-links';
import CareersAssetLight from '$components/illustrations/assets/careers-light.webp';
import CareersAssetDark from '$components/illustrations/assets/careers-dark.webp';
Expand Down Expand Up @@ -97,11 +96,6 @@
<a
class="flex w-full items-center justify-between py-7 text-2xl font-semibold transition-colors hover:text-foreground-secondary"
href={career.full_slug}
on:click={() => {
track(TrackingEvent.CAREER_CLICK, {
props: { name: career.name, to: career.full_slug, path: $page.url.pathname }
});
}}
>
<span>{career.name}</span>
<Button size="sm" variant="secondary" arrow />
Expand All @@ -114,10 +108,7 @@
<p class="leading-none text-foreground-secondary">{t('careers.footer.title')}</p>
<Link
class="mt-0.5 inline-flex underline md:no-underline"
href="mailto:{t('careers.footer.email')}"
on:click={() => {
track(TrackingEvent.CAREERS_SPONTANEOUS_APPLICATION);
}}>{t('careers.footer.description')}</Link
href="mailto:{t('careers.footer.email')}">{t('careers.footer.description')}</Link
>
</div>
</div>
Expand All @@ -131,14 +122,8 @@
<p class="text-2xl font-semibold text-foreground-secondary max-w-md">
{t('careers.footer.no.positions.description')}
</p>
<Button
as="a"
href="mailto:{t('careers.footer.email')}"
on:click={() => {
track(TrackingEvent.CAREERS_SPONTANEOUS_APPLICATION);
}}
size="lg"
class="w-fit mt-8">{t('careers.footer.description')}</Button
<Button as="a" href="mailto:{t('careers.footer.email')}" size="lg" class="w-fit mt-8"
>{t('careers.footer.description')}</Button
>
</div>
<div
Expand Down
2 changes: 0 additions & 2 deletions src/components/pages/careers/canvas-items/checklist.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
import { CheckboxGroup } from '@significa/svelte-ui';
import { CONFETTI_COLOR_ARRAY } from '$lib/constants';
import type { CanvasChecklistStoryblok } from '$types/bloks';
import { TrackingEvent, track } from '$lib/track';

export let item: CanvasChecklistStoryblok;

let selection: string[] = [];
let hasCheckedAllOnce = false;

$: if (selection.length === item.items?.length && !hasCheckedAllOnce) {
track(TrackingEvent.CAREERS_CANVAS_EGGMANDMENDS);
hasCheckedAllOnce = true;
}
</script>
Expand Down
Loading
Loading