mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
Track share events
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
import Toc from "$lib/Toc.svelte";
|
||||
import type { WithContext, Thing } from "schema-dts";
|
||||
import pfpUrl from "$lib/logo.svg?url";
|
||||
import { gtag } from "$lib/analytics.js";
|
||||
// let GhReleasesDownload: Promise<any>;
|
||||
// if (data.ghReleaseData) {
|
||||
// GhReleasesDownload = import("$lib/GhReleasesDownload.svelte").then((m) => m.default)
|
||||
@@ -45,6 +46,14 @@
|
||||
text: data.post.description,
|
||||
url: url.href,
|
||||
});
|
||||
|
||||
gtag("event", "share", {
|
||||
"share_url": url.href,
|
||||
"share_title": data.post.title,
|
||||
"share_button": "article_top",
|
||||
"method": "navigator_share",
|
||||
"content_type": "article",
|
||||
});
|
||||
} catch (error: any) {
|
||||
if (error.toString().includes("AbortError")) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user