Skip to content

Commit

Permalink
Umami Fix
Browse files Browse the repository at this point in the history
Fixing the original code to allow self-hosted configurations.

Signed-off-by: Robert Terakedis <[email protected]>
  • Loading branch information
rterakedis committed Jan 27, 2025
1 parent 821d8fe commit b18d246
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ If using Matomo Analytics, configure the `matomo_analytics` global parameters in

`matomoSiteID` Default is set to 1, change this to the siteid being tracked

If using [Umami Analytics](https://umami.is/), uncomment and configure the `umami_data_website_id` global parameter in your site with the data website ID provided in the script by Umami. It should be in the form of a GUID (# characters): 8-4-4-4-12.
If using [Umami Analytics](https://umami.is/), uncomment and configure the following in *params.toml*:

* `umami_data_website_id` - The data website ID provided in the script by Umami. It should be in the form of a GUID (# characters): 8-4-4-4-12.
* `umami_script_url` - This is pre-loaded with the cloud-hosted Umami Script URL, but can be changed if you are self-hosting.

> NOTE: The head partial only loads analytics if the hugo environment is NOT `development`.
Expand Down
1 change: 1 addition & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,4 @@ matomoSiteID = "1" # Default is set to 1, change this to the siteid being tracke

# Umami Analytics -- https://umami.is/
# umami_data_website_id = "GUID-8-4-4-4-12" # Umami Analytics data website id - GUID format (8-4-4-4-12)
# umami_script_url = "https://cloud.umami.is/script.js" # Umami Analytics script URL
2 changes: 1 addition & 1 deletion layouts/partials/analytics.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
{{- end }}

{{- with $config.umami_data_website_id }}
<script defer src="https://cloud.umami.is/script.js" data-website-id="{{ . }}"></script>
<script defer src="{{ $config.umami_script_url }}" data-website-id="{{ . }}"></script>
{{- end }}

0 comments on commit b18d246

Please sign in to comment.