{ "application_type": "rest_api", "application_params": { "source_params": { "url": "https://analyticsdata.googleapis.com/v1beta/properties/123456789:runReport", "pagination": "offset_limit", "incremental": null, "incremental_stop_import": null, "authentication_type": "oauth2", "oauth2_client_id": "123456789012-0h36umv5n7akaohtrvq3mg7o9k4v6ucr.apps.googleusercontent.com", "oauth2_authorize_url": "https://accounts.google.com/o/oauth2/v2/auth?access_type=offline", "oauth2_token_url": "https://oauth2.googleapis.com/token", "content_type": "json", "oauth2_scope": "https://www.googleapis.com/auth/analytics.readonly", "limit_value": 1000, "request_method": "post", "page_parameter": "page", "page_parameter_in_body": null, "offset_parameter_in_body": true, "limit_parameter_in_body": true, "request_body": "{\n \"dateRanges\":[\n {\n \"startDate\":\"2015-08-14\",\n \"endDate\":\"today\"\n }],\n \"dimensions\":[\n {\n \"name\":\"date\"\n },\n {\n \"name\":\"eventName\"\n }],\n \"metrics\":[\n {\n \"name\":\"sessions\"\n },\n {\n \"name\":\"screenPageViews\"\n }\n ],\n \"offset\": \"{{offset}}\",\n \"limit\": \"{{limit}}\"\n}\n", "custom_javascript_code": "function formatDate(s) {\n return s.substr(0,4)+'-'+s.substr(4,2)+'-'+s.substr(6,2);\n }\n \n return _.map(doc.rows, function(row) {\n var rowdoc = {};\n for (var i = 0; i < doc.dimensionHeaders.length; i++) {\n var name = doc.dimensionHeaders[i].name;\n rowdoc[name] = name == 'date' ? formatDate(row.dimensionValues[i].value) : row.dimensionValues[i].value;\n }\n \n for (var i = 0; i < doc.metricHeaders.length; i++) {\n var metric_name = doc.metricHeaders[i].name;\n rowdoc[metric_name] = row.metricValues[i].value;\n }\n \n return rowdoc;\n });" }, "extra_options": { "regular_import_frequency": 0, "regular_import_at": "", "time_zone": "Helsinki" } }, "source_cube_name": "HansaWorld Invoices", "columns": [ { "name": "date", "data_type": "date", "dimension": "Time" }, { "name": "adCost", "data_type": "decimal" }, { "name": "adClicks", "data_type": "integer" } ] }