Skip to content

Add the analytics script tag with a shortcode and remove some of the worry

Notifications You must be signed in to change notification settings

gingerchew/eleventy-plugin-plausible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plausible Analytics Snippet

Add the analytics script tag with a shortcode and remove some of the worry :)

TODO Before 2.0.0 Fully Releases

  • Test languages other than nunjucks
  • Test each option
    • scriptExtensions
    • proxyPath
    • exclude
    • include
    • async
    • transform
  • Test error handling
    • No domain
    • Invalid JSON
  • Look for edgecases

Using this plugin

const pluginPlausible = require('eleventy-plugin-plausible');

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(pluginPlausible, {
    domain: 'mywebsite.com'
  });
}

Notice

This is a pet project of Ginger (ME) and is in no way related to the team at Plausible Analytics. I am lazy and wanted a shortcode to manage the snippet for my different sites, rather than finding where the head is, copy and pasting. This let me put in the shortcode {% plausible %} and then add the plugin with my website and be done with it.

There's an issue with...

Since this is not maintained by Plausible Analytics, I cannot help you with anything related to their product.

This plugin does 1 thing and 1 thing only, put HTML onto a page. Give it the right domain, and there shouldn't be a problem.

If the snippet that Plausible Analytics uses to track users changes, I will update the template string here when notified. Other than that, there is nothing I can do.

Credits

About

Add the analytics script tag with a shortcode and remove some of the worry

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published