Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2018-11-29 10:22:15 +0300
committerGitHub <noreply@github.com>2018-11-29 10:22:15 +0300
commit73010596f01b9660899267305fe0cf5064428753 (patch)
tree367851f6c476d10f51c0a2a8756f02d260583d83 /tests/javascript/matomotest.js
parent970883b106229f11a071c5470538bfb29dc83871 (diff)
Make matomo.js and matomo.php the default Tracking API endpoints used (#13596)
* Make matomo.js and matomo.php the default Tracking API endpoints used * few fixes * fix few tests * update matomo php tracker in composer * make sure to record install version * do not overwrite ever install version * trying to fix test * more tweaks and fix tests * prefer matomo endpoint in the ui, fix some tests * file was still needed * apply review feedback * fix ui tests
Diffstat (limited to 'tests/javascript/matomotest.js')
-rw-r--r--tests/javascript/matomotest.js94
1 files changed, 94 insertions, 0 deletions
diff --git a/tests/javascript/matomotest.js b/tests/javascript/matomotest.js
new file mode 100644
index 0000000000..514d1c5c8c
--- /dev/null
+++ b/tests/javascript/matomotest.js
@@ -0,0 +1,94 @@
+/*!
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+/*global Piwik getToken */
+
+Piwik.addPlugin('testPlugin', {
+ /*
+ * called when tracker instantiated
+ * - function or string to be eval()'d
+ */
+ run: function (params, registerHookCallback) {
+ registerHookCallback('test',
+ '{' +
+ '_isDefined : isDefined,' +
+ '_isFunction : isFunction,' +
+ '_isObject : isObject,' +
+ '_isString : isString,' +
+ '_isSiteHostName : isSiteHostName,' +
+ '_isSiteHostPath : isSiteHostPath,' +
+ '_getClassesRegExp : getClassesRegExp,' +
+ '_hasCookies : hasCookies,' +
+ '_getCookie : getCookie,' +
+ '_getCookieName : getCookieName,' +
+ '_setCookie : setCookie,' +
+ '_getLinkIfShouldBeProcessed : getLinkIfShouldBeProcessed,' +
+ '_encode : encodeWrapper,' +
+ '_decode : decodeWrapper,' +
+ '_urldecode : urldecode,' +
+ '_getLinkType : getLinkType,' +
+ '_beforeUnloadHandler : beforeUnloadHandler,' +
+ '_getProtocolScheme : getProtocolScheme,' +
+ '_getHostName : getHostName,' +
+ '_getUrlParameter : getUrlParameter,' +
+ '_addUrlParameter : addUrlParameter,' +
+ '_removeUrlParameter : removeUrlParameter,' +
+ '_getVisitorIdFromUrl : getVisitorIdFromUrl,' +
+ '_generateBrowserSpecificId : generateBrowserSpecificId,' +
+ '_makeCrossDomainDeviceId: makeCrossDomainDeviceId,' +
+ '_isSameCrossDomainDevice: isSameCrossDomainDevice,' +
+ '_replaceHrefForCrossDomainLink: replaceHrefForCrossDomainLink,' +
+ '_isLinkToDifferentDomainButSamePiwikWebsite: isLinkToDifferentDomainButSamePiwikWebsite,' +
+ '_urlFixup : urlFixup,' +
+ '_domainFixup : domainFixup,' +
+ '_titleFixup : titleFixup,' +
+ '_sha1 : sha1,' +
+ '_utf8_encode : utf8_encode,' +
+ '_purify : purify,' +
+ '_resolveRelativeReference : resolveRelativeReference,' +
+ '_addEventListener : addEventListener,' +
+ '_prefixPropertyName : prefixPropertyName,' +
+ '_getPiwikUrlForOverlay : getPiwikUrlForOverlay, ' +
+ '_isInsideAnIframe : isInsideAnIframe' +
+ '}'
+ );
+ },
+
+ /*
+ * called when DOM ready
+ */
+ load: function () { },
+
+ /*
+ * function called on trackPageView
+ * - returns URL components to be appended to tracker URL
+ */
+ log: function () {
+ return '&testlog=' + encodeURIComponent('{"token":"' + getToken() + '"}');
+ },
+
+ /*
+ * function called on trackLink() or click event
+ * - returns URL components to be appended to tracker URL
+ */
+ link: function () {
+ return '&testlink=' + encodeURIComponent('{"token":"' + getToken() + '"}');
+ },
+
+ /*
+ * function called on trackGoal()
+ * - returns URL components to be appended to tracker URL
+ */
+ goal: function () {
+ return '&testgoal=' + encodeURIComponent('{"token":"' + getToken() + '"}');
+ },
+
+ /*
+ * called before page is unloaded
+ */
+ unload: function () { }
+});