|
162 | 162 | <paper-toast id="errorToast" duration="5000"></paper-toast>
|
163 | 163 | <paper-toast id="offlineToast" class="offline-toast" text="You are now offline. Can't make new requests."></paper-toast>
|
164 | 164 | <search-bar id="content-search-bar" on-iron-overlay-opened="textSearchBarOpened"></search-bar>
|
165 |
| - <app-analytics tracking-id="UA-18021184-6" app-name="ARC-electon" app-id="[[appId]]" app-version="[[appVersion]]" disable-tracking="{{analyticsDisabled}}" data-source="chrome-app"> |
| 165 | + <app-analytics tracking-id="UA-18021184-6" app-name="ARC-electon" app-id="[[appId]]" app-version="[[appVersion]]" disable-tracking="{{analyticsDisabled}}" data-source="electron-app"> |
166 | 166 | <template is="dom-repeat" items="[[gaCustomMetrics]]">
|
167 | 167 | <app-analytics-custom type="metric" index="[[item.index]]" value="[[item.value]]"></app-analytics-custom>
|
168 | 168 | </template>
|
169 | 169 | <template is="dom-repeat" items="[[gaCustomDimensions]]">
|
170 | 170 | <app-analytics-custom type="dimension" index="[[item.index]]" value="[[item.value]]"></app-analytics-custom>
|
171 | 171 | </template>
|
172 | 172 | </app-analytics>
|
173 |
| - <app-analytics tracking-id="UA-18021184-14" app-name="ARC" app-id="[[appId]]" app-version="[[appVersion]]" data-source="chrome-app" disable-tracking="{{analyticsDisabled}}"> |
| 173 | + <app-analytics tracking-id="UA-18021184-14" app-name="ARC" app-id="[[appId]]" app-version="[[appVersion]]" data-source="electron-app" disable-tracking="{{analyticsDisabled}}"> |
174 | 174 | <template is="dom-repeat" items="[[gaCustomMetrics]]">
|
175 | 175 | <app-analytics-custom type="metric" index="[[item.index]]" value="[[item.value]]"></app-analytics-custom>
|
176 | 176 | </template>
|
177 | 177 | <template is="dom-repeat" items="[[gaCustomDimensions]]">
|
178 | 178 | <app-analytics-custom type="dimension" index="[[item.index]]" value="[[item.value]]"></app-analytics-custom>
|
179 | 179 | </template>
|
180 | 180 | </app-analytics>
|
181 |
| - <app-analytics tracking-id="UA-71458341-2" app-name="ARC" app-id="[[appId]]" app-version="[[appVersion]]" data-source="chrome-app" disable-tracking="{{analyticsDisabled}}"> |
| 181 | + <app-analytics tracking-id="UA-71458341-2" app-name="ARC" app-id="[[appId]]" app-version="[[appVersion]]" data-source="electron-app" disable-tracking="{{analyticsDisabled}}"> |
182 | 182 | <template is="dom-repeat" items="[[gaCustomMetrics]]">
|
183 | 183 | <app-analytics-custom type="metric" index="[[item.index]]" value="[[item.value]]"></app-analytics-custom>
|
184 | 184 | </template>
|
|
204 | 204 | <script>
|
205 | 205 | const {ArcPreferences} = require('./scripts/arc-preferences');
|
206 | 206 | const ipc = require('electron').ipcRenderer;
|
207 |
| - |
| 207 | + const {app} = require('electron').remote; |
208 | 208 | Polymer({
|
209 | 209 | is: 'arc-electron',
|
210 | 210 |
|
|
214 | 214 | route: Object,
|
215 | 215 | routeData: Object,
|
216 | 216 | driveFileRoute: Object,
|
217 |
| - appId: String, |
218 |
| - appVersion: String, |
| 217 | + // Application ID for analytics |
| 218 | + appId: { |
| 219 | + type: String, |
| 220 | + value: 'com.mulesoft.arc' |
| 221 | + }, |
| 222 | + // Current application varsion |
| 223 | + appVersion: { |
| 224 | + type: String, |
| 225 | + value: function() { |
| 226 | + return app.getVersion(); |
| 227 | + } |
| 228 | + }, |
219 | 229 | gaCustomMetrics: Array,
|
220 | 230 | gaCustomDimensions: Array,
|
221 | 231 | drawerWidth: {
|
|
285 | 295 | this.set('route.path', '/request/latest/0');
|
286 | 296 | }
|
287 | 297 | this._requestAuthToken(false);
|
| 298 | + this.setupAnalytics(); |
| 299 | + }, |
| 300 | + |
| 301 | + setupAnalytics: function() { |
| 302 | + this.gaCustomDimensions = []; |
| 303 | + this.push('gaCustomDimensions', { |
| 304 | + index: 1, |
| 305 | + value: process.versions.chrome |
| 306 | + }); |
| 307 | + this.push('gaCustomDimensions', { |
| 308 | + index: 2, |
| 309 | + value: this.appVersion |
| 310 | + }); |
| 311 | + this.push('gaCustomDimensions', { |
| 312 | + index: 5, |
| 313 | + value: 'stable' |
| 314 | + }); |
288 | 315 | },
|
289 | 316 |
|
290 | 317 | _setupRequestRoute: function(record) {
|
|
0 commit comments