Skip to content

Commit

Permalink
Polish analytics docs (#2456)
Browse files Browse the repository at this point in the history
Fixes #2304
  • Loading branch information
hadley authored Apr 17, 2024
1 parent a319c9c commit a33d9d3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
30 changes: 17 additions & 13 deletions R/build.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,23 @@
#'
#' @section Analytics:
#'
#' To capture usage of your site with a web analytics platform, you can make
#' use of the `includes` field to add the HTML supplied to you by the platform.
#' Typically these are either placed `after_body` or `in_header`. I include
#' a few examples below, but I highly recommend getting the recommended HTML
#' directly from the platform.
#' To capture usage of your site with a web analytics tool, you can make
#' use of the `includes` field to add the special HTML they need. This HTML
#' is typically placed `in_header` (actually in the `<head>`), `before_body`,
#' or `after_body`.
#' You can learn more about how includes work in pkgdown at
#' <https://pkgdown.r-lib.org/articles/customise.html#additional-html-and-files>.
#'
#' * [GoatCounter](https://www.goatcounter.com):
#' I include a few examples of popular analytics platforms below, but we
#' recommend getting the HTML directly from the tool:
#'
#' * [plausible.io](https://plausible.io):
#'
#' ```yaml
#' template:
#' includes:
#' after_body: >
#' <script data-goatcounter="https://{YOUR CODE}.goatcounter.com/count" data-goatcounter-settings="{YOUR SETTINGS}" async src="https://gc.zgo.at/count.js"></script>
#' in_header: |
#' <script defer data-domain="{YOUR DOMAIN}" src="https://plausible.io/js/plausible.js"></script>
#' ```
#'
#' * [Google analytics](https://analytics.google.com/analytics/web/):
Expand All @@ -199,16 +203,16 @@
#' gtag('config', '{YOUR TRACKING ID}');
#' </script>
#' ```
#'
#' * [plausible.io](https://plausible.io):
#' * [GoatCounter](https://www.goatcounter.com):
#'
#' ```yaml
#' templates:
#' template:
#' includes:
#' in_header: |
#' <script defer data-domain="{YOUR DOMAIN}" src="https://plausible.io/js/plausible.js"></script>
#' after_body: >
#' <script data-goatcounter="https://{YOUR CODE}.goatcounter.com/count" data-goatcounter-settings="{YOUR SETTINGS}" async src="https://gc.zgo.at/count.js"></script>
#' ```
#'
#'
#' @section Source repository:
#' Use the `repo` field to override pkgdown's automatically discovery
#' of your source repository. This is used in the navbar, on the homepage,
Expand Down
28 changes: 16 additions & 12 deletions man/build_site.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a33d9d3

Please sign in to comment.