Track share events
This commit is contained in:
parent
b7e399b528
commit
3b2e909949
1 changed files with 9 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue