CreateReportSchema
Creates a schema file based on an existing report in the Google Ad Manager UI by setting the BaseReportName input to the original report. If you want to generate a report from scratch, leave the BaseReportName blank.
CreateReportSchema
CreateReportSchema creates a schema file based on the specified report. This schema adds a table to your existing list that corresponds with the results of your report, which can then be queried like other tables. (Reports from the Google Ads Manager are not modeled by adapter as queryable tables by default.)The generated schema file outlines the metadata for the report, such as columns and column data types. You can edit the file to adjust data types, rename columns, and include or exclude columns.
Updating a Report Schema
In the following example, the SP CreateReportSchema creates a new report using TestReportTest1 as a base template. It appends new columns to TestReportTest1 and creates a new report, named TestReport2. The new report is saved as ...\\TestReportTest2.rsd.EXECUTE [CreateReportSchema] [ReportName] = "TestReportTest2", [CustomFieldIdsPrimitive] = "1459925,1459928", [CustomFieldIdsDropdown] = "1469785", [CustomDimensionKeyIds] = "13539564", [BaseReportName] = "TestReportTest1", [FileName] = "...\\TestReportTest2.rsd"
Input
Name | Type | Required | Description |
ReportName | String | True | The name of the report. |
BaseReportName | String | False | The original report name that the new report will be based on. To generate a report from scratch, leave this field blank. |
FileName | String | False | The full file path and name of the schema to generate. Ex : 'C:/Users/User/Desktop/SampleReport.rsd' |
Metrics | String | False | Metrics of the report separated by comma. Ex: 'AD_SERVER_IMPRESSIONS,AD_SERVER_TARGETED_IMPRESSIONS,AD_SERVER_CLICKS,AD_SERVER_TARGETED_CLICKS'. This input is required if you are creating the report schema from scratch (have omitted the BaseReportName). If you have set the BaseReportName to an original report name, either leave this input empty or add only those values that do not exist in the original report. |
Dimensions | String | False | Dimensions of the report separated by comma. Ex: 'MONTH_AND_YEAR,WEEK,DATE,DAY,CUSTOM_DIMENSION,ORDER_NAME'. This input is required if you are creating the report schema from scratch (have omitted the BaseReportName). If you have set the BaseReportName to an original report name, either leave this input empty or add only those values that do not exist in the original report. |
CustomFieldIdsPrimitive | String | False | The list of CustomField.id (Number, Toggle or Text type) separated by comma. Ex: '1459925,1459958'. To add a CustomField to the report, you must also include its corresponding dimension in the list of Dimensions. |
CustomFieldIdsDropdown | String | False | The list of CustomField.id (Drop-down type) separated by comma. Ex: '1459925,1459958'. To add a CustomField to the report, you must also include its corresponding dimension in the list of Dimensions. |
CustomDimensionKeyIds | String | False | The list of custom dimension custom targeting key IDs separated by comma. Ex: '13539564,13539567'. To add a custom dimension key ID, you must include 'CUSTOM_DIMENSION' in the list of Dimensions. |
AdUnitView | String | False | The view for an ad unit report. With TOP_LEVEL, only the top level ad units are included, and metrics include events for their descendants that are not filtered out. With FLAT, all ad units are included, and metrics do not include events for the descendants.
The allowed values are TOP_LEVEL, FLAT. |
ReportCurrency | String | False | The currency for revenue metrics. Defaults to the network currency if left null. The supported currency codes can be found in 'support.google.com/admanager/answer/6019533'. |
TimeZoneType | String | False | Time zone that is used in the report. Set to 'PUBLISHER' to use the the publisher's time zone. For Ad Manager reports, this time zone is compatible with all metrics. For Ad Exchange reports, this time zone is not compatible with 'Bids' and 'Deals' metrics. If your report includes 'time unit' dimensions, only the Ad Manager 'time unit' dimensions are compatible. Set to 'PACIFIC' to use the PT time zone. This time zone is only compatible with Ad Exchange metrics in Historical report type. If your report includes 'time unit' dimensions, only the PT 'time unit' dimensions are compatible.
The allowed values are PUBLISHER, PACIFIC. |
Result Set Columns
Name | Type | Description |
FileData | String | The schema's content encoded in BASE64. Only used if FileName and FileStream are not set. |
Success | String | Returns True if the report is successfully created. |