Get more examples and tutorials at the googleAnalyticsR website
install.packages("googleAnalyticsR")
remotes::install_github("MarkEdmondson1234/googleAnalyticsR")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.