linking1Add my vote for this tag rendering1Add my vote for this tag create new tag
, view all tags

External Link Tracker Plugin

Track and report on users clicking on external links


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.orgExternal site.

The external links with IDs are defined in a table in ExternalLinkTrackerDefinition. Example - for illustration only:

ID Name URL Comment
TWiki TWiki.org http://twiki.org/  

External link statistics

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.


  • %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:
      1. Create a group in TWikiGroups called ExternalLinkAdminGroup; add members as needed
      2. 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

Plugin Author: TWiki:Main.PeterThoeny
Copyright: © 2012 Nuclearconst.net
© 2012 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2012-11-12
Change History:
2012-11-12: TWikibug:Item7020: Categorize TWiki Variable EXLINK
2012-09-18: TWikibug:Item6935: Configure setting to open up external link in a new window or tab
2012-09-13: TWikibug:Item6926: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.2
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins.Benchmark: GoodStyle 100%, FormattedSearch 100%, ExternalLinkTrackerPlugin 98%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ExternalLinkTrackerPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ExternalLinkTrackerPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ExternalLinkTrackerPluginAppraisal

Related Topics: ExternalLinkTrackerStatistics, ExternalLinkTrackerDefinition, ExternalLinkTrackerDefinitionTemplate, VarEXLINK, TWikiPlugins, AdminDocumentationCategory

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 ExternalLinkTrackerPlugin.md5 r3 r2 r1 manage 0.2 K 2012-11-12 - 08:41 PeterThoeny  
Compressed Zip archivetgz ExternalLinkTrackerPlugin.tgz r3 r2 r1 manage 261.3 K 2012-11-12 - 08:41 PeterThoeny  
Compressed Zip archivezip ExternalLinkTrackerPlugin.zip r3 r2 r1 manage 266.2 K 2012-11-12 - 08:41 PeterThoeny  
Unknown file formatEXT ExternalLinkTrackerPlugin_installer r1 manage 3.9 K 2012-11-12 - 08:41 PeterThoeny  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2013-10-16 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.