Swiftpack.co - marcelvoss/MatomoPublishPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by marcelvoss.
marcelvoss/MatomoPublishPlugin 0.1.0
A Publish plugin for injecting Matomo tracking code into your website.
⭐️ 0
🕓 3 weeks ago
.package(url: "https://github.com/marcelvoss/MatomoPublishPlugin.git", from: "0.1.0")


MatomoPublishPlugin is a tiny Swift package that provides a way of injecting Matomo (previously Piwik) HTML tracking code into any generation pipeline of the Publish static-site generator.

This does not use any JavaScript and keeps your site static by only injecting an image-based tracking beacon. It is less evil than JavaScript and collects less information about any users of your website.


To install it into your Publish package, add it as a dependency within your Package.swift manifest:

let package = Package(
    dependencies: [
        .package(name: "MatomoPublishPlugin", url: "https://github.com/marcelvoss/MatomoPublishPlugin", from: "0.1.0")
    targets: [
            dependencies: [

Then import SplashPublishPlugin wherever you’d like to use it:

import MatomoPublishPlugin


The plugin can then be used within any publishing pipeline like this:

import SplashPublishPlugin
try DeliciousRecipes().publish(using: [
    .generateHTML(withTheme: .theme),
    .installPlugin(.track(using: .init(siteIdentifier: your-site-identifier,
                                                       trackingInstallationURL: URL(string: "https://your-matomo-installation.com")!))),

Just keep in mind to install the plugin after your generateHTML step, as it modifies the previously generated HTML files.


Stars: 0
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics