File tree Expand file tree Collapse file tree 3 files changed +27
-4
lines changed
Expand file tree Collapse file tree 3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 9494 */
9595 options : null ,
9696
97- output : 'dataTable' ,
98-
9997 data : null ,
10098
10199 publish : {
138136 }
139137 } ,
140138
139+ beforeQuerySend : function ( query ) {
140+ query . output = 'dataTable' ;
141+ query . _src = 'gwc-ga-chart' ;
142+ } ,
143+
141144 handleResponse : function ( response ) {
142145 if ( response . error ) {
143146 this . fire ( 'analytics-query-error' , response . error ) ;
164167 function queryMetadataAPI ( ) {
165168 return new Promise ( function ( resolve , reject ) {
166169 gapi . client . analytics . metadata . columns
167- . list ( { reportType :'ga' } )
170+ . list ( {
171+ reportType : 'ga' ,
172+ _src : 'gwc-ga-chart'
173+ } )
168174 . execute ( function ( response ) {
169175 if ( response . error ) {
170176 reject ( response . error ) ;
Original file line number Diff line number Diff line change 262262 if ( this . output ) query . output = this . output ;
263263 if ( this . fields ) query . fields = this . fields ;
264264
265+ this . beforeQuerySend ( query ) ;
266+
265267 gapi . client . analytics . data . ga . get ( query )
266268 . execute ( this . handleResponse . bind ( this ) ) ;
267269
285287 }
286288 } ,
287289
290+ /**
291+ * A hook to alter the query params object (if needed) before
292+ * the request is made. This method allows subclasses to change the
293+ * request without overriding the entire `getData` method.
294+ *
295+ * @method beforeQuerySend
296+ * @param {Object } query - The query params object.
297+ */
298+ beforeQuerySend : function ( query ) {
299+ query . _src = 'gwt-ga-query' ;
300+ } ,
301+
288302 get hasRequiredParams ( ) {
289303 return ! ! ( this . ids && this . metrics && this . startDate && this . endDate ) ;
290304 } ,
Original file line number Diff line number Diff line change 230230 var summaries = [ ] ;
231231 function makeRequest ( startIndex ) {
232232 gapi . client . analytics . management . accountSummaries
233- . list ( { 'start-index' : startIndex || 1 } )
233+ . list ( {
234+ 'start-index' : startIndex || 1 ,
235+ '_src' : 'gwc-ga-view-selector'
236+ } )
234237 . execute ( ensureComplete ) ;
235238 }
236239 function ensureComplete ( resp ) {
You can’t perform that action at this time.
0 commit comments