lib/google.js
function getViews(property, options) {
    logger.debug('getting views for', property);
    return analytics.management.profiles.listAsync({
        auth: auth,
        accountId: accountId,
        webPropertyId: property.id
    })
    .then((profiles) => {
        // If we're not grouping by view, then only include the default view
        // named "All Web Site Data". Otherwise the counts can potentially be
        // duplicated.
        if (options.metagroup !== 'view') {
            profiles.items = _.where(profiles.items, {name: 'All Web Site Data'});
        }
        return _.map(profiles.items, (profile) => {
            return {
                webPropertyId: property.id,
                webProperty: property.name,
                viewId: profile.id,
                view: profile.name
            };
        });
    });
}
function getViews(property, options) {
    logger.debug('getting views for', property);
    return analytics.management.profiles.listAsync({
        auth: auth,
        accountId: accountId,
        webPropertyId: property.id
    })
    .then((profiles) => {
        // If we're not grouping by view, then only include the default view
        // named "All Web Site Data". Otherwise the counts can potentially be
        // duplicated.
        if (options.metagroup !== 'view') {
            profiles.items = _.where(profiles.items, {name: 'All Web Site Data'});
        }
        return _.map(profiles.items, (profile) => {
            return {
                webPropertyId: property.id,
                webProperty: property.name,
                viewId: profile.id,
                view: profile.name
            };
        });
    });
}
function getViews ( property , options ) { logger . debug ( 'getting views for' , property ) ; return analytics . management . profiles . listAsync ( { auth : auth , accountId : accountId , webPropertyId : property . id } ) . then ( ( profiles ) => { // If we're not grouping by view, then only include the default view // named "All Web Site Data". Otherwise the counts can potentially be // duplicated. if ( options . metagroup !== 'view' ) { profiles . items = _ . where ( profiles . items , { name : 'All Web Site Data' } ) ; } return _ . map ( profiles . items , ( profile ) => { return { webPropertyId : property . id , webProperty : property . name , viewId : profile . id , view : profile . name } ; } ) ; } ) ; }
Get all views for the given property
Get all views for the given property