You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tracking Code Customizer plugin for the Piwik Web Analytics software package
3
+
4
+
##Description
5
+
Allows Piwik admininstrators to customize the tracking code that is autogenerated for users. This is useful for directing requests to the correct servers in a multi-server setup, include additional parameters in default tracking, or to perform conditional checks before initiating a tracking call.
6
+
7
+
##Instructions
8
+
The easiest way to install is to find the plugin in the [Piwik Marketplace](http://plugins.piwik.org/).
9
+
10
+
##Usage
11
+
12
+
Set additional default OPTIONS for tracking. The follwing is entered into the "options" field.
13
+
14
+
```javascript
15
+
if (typeof(hash) !=='undefined'){_paq.push(['setCustomVariable','1','U',hash,'visit']); _paq.push(['setUserId',hash]);};
16
+
```
17
+
Resultant tracking code
18
+
```javascript
19
+
20
+
<!-- Piwik -->
21
+
<script type="text/javascript">
22
+
var _paq = _paq || [];
23
+
if (typeof(hash) !=='undefined'){_paq.push(['setCustomVariable','1','U',hash,'visit']); _paq.push(['setUserId',hash]);};
24
+
_paq.push(['trackPageView']);
25
+
_paq.push(['enableLinkTracking']);
26
+
var u="//webanalytics-tracker.XXXX.XXX/";
27
+
_paq.push(['setTrackerUrl', u+'piwik.php']);
28
+
_paq.push(['setSiteId', 1]);
29
+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
"PluginDescription":"The provided values will replace the defaults in the generated tracking code (leave blank to use defaults). Viewing https://github.com/piwik/piwik/blob/master/core/Tracker/TrackerCodeGenerator.php is recommended to deconstruct how the tracking code is built.",
4
+
"idSiteSettingTitle":"idSite",
5
+
"idSiteSettingDescription":"The siteId that will be included in the tracking code.",
"optionsBeforeTrackerUrlSettingDescription":"A string of Javascript code that customizes the JavaScript tracker inside of anonymous function before adding setTrackerUrl into paq."
"description": "Allows Piwik admininstrators to customize the tracking code that is autogenerated for users. This is useful for directing requests to the correct servers in a multi-server setup, include additional parameters in default tracking, or to perform conditional checks before initiating a tracking call. ",
0 commit comments