From CRAN:
install.packages("googleAnalyticsR")
Or the latest development version on GitHub:
remotes::install_github("8-bit-sheep/googleAnalyticsR")
Examples and tutorials available at https://8-bit-sheep.com/googleAnalyticsR.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.