Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: runtime/observatory/lib/src/app/analytics.dart

Issue 1236223002: Do not report Observatory analytics when running in Dart (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/app/analytics.dart
diff --git a/runtime/observatory/lib/src/app/analytics.dart b/runtime/observatory/lib/src/app/analytics.dart
index 74efc7f42b6b2bf4d717d85dc769f7f05ebee0dd..cb6a91fbff4e06498bfe6de494a8a48ff0209bac 100644
--- a/runtime/observatory/lib/src/app/analytics.dart
+++ b/runtime/observatory/lib/src/app/analytics.dart
@@ -19,8 +19,13 @@ class Analytics {
/// Called whenever an Observatory page is viewed.
static Future reportPageView(Uri uri) {
- // The screen name is the uri's path. e.g. inspect, profile.
- final screenName = uri.path;
- return _googleAnalytics.sendScreenView(screenName);
+ // Only report analytics when running in JavaScript.
+ if (Utils.runningInJavaScript()) {
+ // The screen name is the uri's path. e.g. inspect, profile.
+ final screenName = uri.path;
+ return _googleAnalytics.sendScreenView(screenName);
+ } else {
+ return new Future.value(null);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698