From f84cd9377360b68a77d52f427152b8da1e624808 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Wed, 10 Sep 2014 16:39:26 +0200 Subject: merged userid --- js/piwik.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'js') diff --git a/js/piwik.js b/js/piwik.js index f9309c217f..1c8b48c6d9 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -408,7 +408,7 @@ if (typeof JSON2 !== 'object') { exec, res, width, height, devicePixelRatio, pdf, qt, realp, wma, dir, fla, java, gears, ag, - hook, getHook, getVisitorId, getVisitorInfo, setSiteId, setTrackerUrl, appendToTrackingUrl, getRequest, addPlugin, + hook, getHook, getVisitorId, getVisitorInfo, setUserId, setSiteId, setTrackerUrl, appendToTrackingUrl, getRequest, addPlugin, getAttributionInfo, getAttributionCampaignName, getAttributionCampaignKeyword, getAttributionReferrerTimestamp, getAttributionReferrerUrl, setCustomData, getCustomData, @@ -2044,6 +2044,9 @@ if (typeof Piwik !== 'object') { // Site ID configTrackerSiteId = siteId || '', + // User ID + configUserId = '', + // Document URL configCustomUrl, @@ -2732,6 +2735,7 @@ if (typeof Piwik !== 'object') { '&h=' + now.getHours() + '&m=' + now.getMinutes() + '&s=' + now.getSeconds() + '&url=' + encodeWrapper(purify(currentUrl)) + (configReferrerUrl.length ? '&urlref=' + encodeWrapper(purify(configReferrerUrl)) : '') + + (configUserId.length ? '&uid=' + encodeWrapper(configUserId) : '') + '&_id=' + uuid + '&_idts=' + createTs + '&_idvc=' + visitCount + '&_idn=' + newVisitor + // currently unused (campaignNameDetected.length ? '&_rcn=' + encodeWrapper(campaignNameDetected) : '') + @@ -3943,6 +3947,15 @@ if (typeof Piwik !== 'object') { configTrackerSiteId = siteId; }, + /** + * Sets a User ID to this user (such as an email address or a username) + * + * @param string User ID + */ + setUserId: function (userId) { + configUserId = userId; + }, + /** * Pass custom data to the server * -- cgit v1.2.3