diff --git a/internal/cli/serve/command.go b/internal/cli/serve/command.go
index c49c637..8f1ea22 100644
--- a/internal/cli/serve/command.go
+++ b/internal/cli/serve/command.go
@@ -317,13 +317,18 @@ func (cmd *command) Run(ctx context.Context, log *logger.Logger, cfg *config.Con
// url=https%3A%2F%2Ferror-pages.goatcounter.com%2Fcounter%2F%2Fuse-template%2Flost-in-space.json
// &query=%24.count&label=Used%20times)
go func() {
+ var tpl = url.QueryEscape(cfg.TemplateName)
+
req, reqErr := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf(
- "https://error-pages.goatcounter.com/count?event=true&p=/use-template/%s", url.QueryEscape(cfg.TemplateName),
+ // https://www.goatcounter.com/help/pixel
+ "https://error-pages.goatcounter.com/count?e=true&p=/use-template/%s&t=%s", tpl, tpl,
), http.NoBody)
if reqErr != nil {
return
}
+ req.Header.Set("User-Agent", "error-pages") // by default, the User-Agent is "Go-http-client/x.x"
+
resp, respErr := (&http.Client{Timeout: 10 * time.Second}).Do(req) //nolint:mnd // don't care about the response
if respErr != nil {
log.Debug("Cannot send a request to increment the template usage counter", logger.Error(respErr))
diff --git a/templates/app-down.html b/templates/app-down.html
index 2179fcd..7a08194 100644
--- a/templates/app-down.html
+++ b/templates/app-down.html
@@ -500,7 +500,7 @@
-
+