Skip to content

Commit

Permalink
Fixes #3819
Browse files Browse the repository at this point in the history
Fixes #3818: you can now call piwikTracker.appendToTrackingUrl('lat=X&long=Y');
_and_ disable auth in your config.ini.php
 https://github.com/piwik/piwik/blob/master/config/global.ini.php#L411

+ Adding test
  • Loading branch information
mattab committed Mar 13, 2013
1 parent f69ad85 commit e794cb3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
19 changes: 17 additions & 2 deletions js/piwik.js
Expand Up @@ -401,7 +401,7 @@ if (!this.JSON2) {
exec,
res, width, height, devicePixelRatio,
pdf, qt, realp, wma, dir, fla, java, gears, ag,
hook, getHook, getVisitorId, getVisitorInfo, setTrackerUrl, setSiteId,
hook, getHook, getVisitorId, getVisitorInfo, setTrackerUrl, appendToTrackingUrl, setSiteId,
getAttributionInfo, getAttributionCampaignName, getAttributionCampaignKeyword,
getAttributionReferrerTimestamp, getAttributionReferrerUrl,
setCustomData, getCustomData,
Expand Down Expand Up @@ -1064,6 +1064,9 @@ var
// Tracker URL
configTrackerUrl = trackerUrl || '',

// This string is appended to the Tracker URL Request (eg. to send data that is not handled by the existin setters/getters)
configAppendToTrackingUrl = '',

// Site ID
configTrackerSiteId = siteId || '',

Expand Down Expand Up @@ -1725,6 +1728,9 @@ var
// tracker plugin hook
request += executePluginMethod(pluginMethod);

if (configAppendToTrackingUrl.length) {
request += '&' + configAppendToTrackingUrl;
}
return request;
}

Expand Down Expand Up @@ -2321,8 +2327,17 @@ var
},

/**
* Get custom data
* Appends the specified query string to the piwik.php?... Tracking API URL
*
* @param queryString eg. 'lat=140&long=100'
*/
appendToTrackingUrl: function (queryString) {
configAppendToTrackingUrl = queryString;
},

/**
* Get custom data
*skk
* @return mixed
*/
getCustomData: function () {
Expand Down

0 comments on commit e794cb3

Please sign in to comment.