mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +00:00
Fix googleanalytics plugin to be platform-specific
This commit is contained in:
parent
78ba57d55d
commit
5b5621a600
@ -14,13 +14,13 @@ Runs Google Analytics with the account number in the tiddler `$:/GoogleAnalytics
|
||||
|
||||
// Export name and synchronous status
|
||||
exports.name = "google-analytics";
|
||||
exports.platforms = ["browser"];
|
||||
exports.synchronous = true;
|
||||
|
||||
var GOOGLE_ANALYTICS_ACCOUNT = "$:/GoogleAnalyticsAccount",
|
||||
GOOGLE_ANALYTICS_DOMAIN = "$:/GoogleAnalyticsDomain";
|
||||
|
||||
exports.startup = function() {
|
||||
if($tw.browser) {
|
||||
window._gaq = window._gaq || [];
|
||||
_gaq.push(["_setAccount", $tw.wiki.getTiddlerText(GOOGLE_ANALYTICS_ACCOUNT)]);
|
||||
_gaq.push(["_setDomainName", $tw.wiki.getTiddlerText(GOOGLE_ANALYTICS_DOMAIN)]);
|
||||
@ -30,7 +30,6 @@ exports.startup = function() {
|
||||
ga.async = true;
|
||||
ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
|
||||
document.body.appendChild(ga);
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user