diff --git a/config/_default/config.toml b/config/_default/config.toml index 62b7d75c..504a8d0b 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -1,4 +1,4 @@ -baseURL = '/' +baseURL = 'https://inlive.app/' languageCode = 'en-us' title = 'inLive' theme = 'inlive' @@ -15,4 +15,4 @@ maxAge = "10s" [markup] [markup.goldmark] [markup.goldmark.renderer] - unsafe = true \ No newline at end of file + unsafe = true diff --git a/themes/inlive/layouts/partials/head/analytics.html b/themes/inlive/layouts/partials/head/analytics.html index 345dbbc7..0e9484fd 100644 --- a/themes/inlive/layouts/partials/head/analytics.html +++ b/themes/inlive/layouts/partials/head/analytics.html @@ -27,6 +27,30 @@ title: document.title || '-', description: document.querySelector('meta[name="description"]')?.content || '-' }); + + // register UTM if exists + if(window.URL){ + const url = new URL(window.location.href) + const source=url.searchParams.get("utm_source") + + if(source!==null){ + const utm = {} + const medium=url.searchParams.get("utm_medium") + const campaign=url.searchParams.get("utm_campaign") + const content=url.searchParams.get("utm_content") + const term=url.searchParams.get("utm_term") + + utm["utm_source"] = source + + if(medium!==null) utm["utm_medium"] = medium + if(campaign!==null) utm["utm_campaign"] = campaign + if(content!==null) utm["utm_content"] = content + if(term!==null) utm["utm_term"] = term + + mixpanel.register_once(utm); + } + } + {{ end }}