External Link Tracker Plugin
Track and report on users clicking on external links
Introduction
The goal of this plugin is to track users clicking on external links, and to report on external link tracking statistics. Links are obfuscated and identified only by link IDs, e.g. users can't see the destination link in view mode and edit mode.
An external link is written as
%EXLINK{ID}%
, with
ID
representing the link identifier. For example,
%EXLINK{TWiki}%
renders as
TWiki.org.
The external links with IDs are defined in a table in
ExternalLinkTrackerDefinition. Example - for illustration only:
External Link Tracker Statistics
The
ExternalLinkTrackerStatistics topic shows external link tracking statistics. The statistics are typically restricted to members of the
ExternalLinkAdminGroup.
Syntax Rules
%EXLINK{ID}%
- the
ID
identifies the external link.
Examples
-
%EXLINK{Google}%
expands to: %EXLINK{Google}%
-
%EXLINK{TWiki}%
expands to: %EXLINK{TWiki}%
Plugin Installation & Configuration
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.
- For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.
- Or, follow these manual installation steps:
- Download the ZIP file from the Plugins home (see below).
- Unzip
ExternalLinkTrackerPlugin.zip
in your twiki installation directory. Content: File: | Description: |
data/TWiki/ExternalLinkTrackerPlugin.txt | Plugin topic |
data/TWiki/ExternalLinkTrackerDefinitionTemplate.txt | External link tracker definition template |
data/TWiki/ExternalLinkTrackerStatistics.txt | External link tracker statistics topic |
data/TWiki/VarEXLINK.txt | EXLINK variable documentation topic |
lib/TWiki/Plugins/ExternalLinkTrackerPlugin.pm | Plugin Perl module |
lib/TWiki/Plugins/ExternalLinkTrackerPlugin/Config.spec | Configure spec file |
lib/TWiki/Plugins/ExternalLinkTrackerPlugin/Core.pm | Plugin core module |
- Set the ownership of the extracted directories and files to the webserver user.
- Plugin configuration and testing:
- Run the configure script and enable the plugin in the Plugins section.
- Make sure the
{AllowRedirectUrl}
configure setting is checked in the Security setup section (this is an expert setting).
- Configure additional plugin settings in the Extensions section:
-
{Plugins}{ExternalLinkTrackerPlugin}{ExternalIcon}
- Flag to show a small external icon next to external links.
-
{Plugins}{ExternalLinkTrackerPlugin}{NewWindow}
- Flag to open up external link in a new window or tab.
-
{Plugins}{ExternalLinkTrackerPlugin}{ForceAuth}
- Force authentication before redirecting to external links. If not set and if a non-authenticated user follows an external link, he/she will be recorded as TWikiGuest. It does not need to be set if users are authenticated at all times on the TWiki site.
-
{Plugins}{ExternalLinkTrackerPlugin}{AdminGroup}
- Group that defines who can see the external link tracker statistics. Set to empty value to open it up to all. Default: ExternalLinkAdminGroup
-
{Plugins}{ExternalLinkTrackerPlugin}{Debug}
- Debug plugin flag. See output in data/debug.txt
- Define the external links with IDs:
- If you want to restrict access to the statistics page:
- Create a group in TWikiGroups called
ExternalLinkAdminGroup
; add members as needed
- Edit ExternalLinkTrackerDefinition and enable the access restriction by uncommenting the two access control settings, e.g. remove the
#
characters from #Set ALLOWTOPIC...
- Test if the installation was successful using the example above.
Plugin Info
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Track and report on users clicking on external links
Related Topics: ExternalLinkTrackerStatistics,
ExternalLinkTrackerDefinition,
ExternalLinkTrackerDefinitionTemplate,
VarEXLINK,
TWikiPlugins,
AdminDocumentationCategory