Code Monkey home page Code Monkey logo

dokuwiki-plugin-googleanalytics's Introduction

Google Analytics for DokuWiki

License

About

This tool allows you to set a code for use with Google Analytics, which allows you to track your visitors.

This plugin generates JavaScript code that is automatically included into your site via the lib/exe/js.php file. (Which you can inspect via your browser's "developer tools.")

Set the options for this plugin via the Configuration Settings menu from the DokuWiki admin menu. (It will be near the bottom of the page.)

You may use one of two tracking options:

  • Basic "Google Analytics ID" (also known as "analytics.js") using a UA-XXXXXX-XX code
  • Newer "Global Site Tag ID" (also known as "gtag.js") using a G-XXXXXXXXXX code

If you set a "Global Site Tag ID", then this method will be used and any "Google Analytics ID" / UA-XXXXXXX-XX specific settings will be ignored.

Advanced Usage

To use the advanced "tagging" features of analytics.js or gtag.js, you will need to be able to embed JavaScript within your DokuWiki pages. You can accomplish this in one of three ways:

  • Enabling embedded HTML in your local DokuWiki instance (Look for htmlok in Configuration Settings)
  • Allow embedded JavaScript via a plugin like the InlineJS Plugin
  • Edit your site's template to add "tagging" directly

Allowing embedded HTML / JavaScript will give you the most flexibility for per-page tagging, but it can open your site to Cross-site Scripting attacks if you're not careful. If you lock down who can edit your wiki pages and trust your users, you should be fine though.

If you edit your template (the third option), make sure to make notes of what you change, as "upgrading" your template will revert any changes you've made.

Install / Upgrade

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Setup

All further documentation for this plugin can be found at:

Contributing

The official repository for this plugin is available on GitHub:

The plugin thrives from community contributions. If you're able to provide useful code changes or bug fixes, they will likely be accepted to future versions of the plugin.

If you find my work helpful and would like to give back, consider joining me as a GitHub sponsor.

Thanks!

--Terence

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.