GoogleAnalyticsPublishPlugin
A plugin for enabling Google Analytics when using Publish](https://github.com/johnsundell/publish).
Note
Important This plugin does not work on official Publish yet.
Rather, it needs a forked version of Publish by now.
Use at your own risk.
Installation
Add GoogleAnalyticsPublishPlugin
to your package.
let package = Package(
...
dependencies: [
.package(url: "https://github.com/Ze0nC/GoogleAnalyticsPublishPlugin", .branch("master"))
],
targets: [
.target(
...
dependencies: [
...
"GoogleAnalyticsPublishPlugin"
]
)
]
...
)
Usage
-
Get your Tracking ID for your site at Google Analytics.
-
Add the plugin with Tracking ID to your build pipeline (before HTML files are generated).
import GoogleAnalyticsPublishPlugin
...
try MyWebsite().publish(using: [
.addMarkdownFiles(),
.installPlugin(.googleAnalytics(trackingID: "YOUR-TRACKING-ID")),
...
.generateHTML(withTheme: .foundation),
...
])
Done!
License
MIT License