google_api_ad_sense v0.4.0 GoogleApi.AdSense.V14.Api.Reports View Source

API calls for all endpoints tagged Reports.

Link to this section Summary

Functions

Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.

Generate an AdSense report based on the saved report ID sent in the query parameters.

List all saved reports in this AdSense account.

Link to this section Functions

Link to this function

adsense_reports_generate(connection, start_date, end_date, optional_params \\ [], opts \\ []) View Source

Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.

Parameters

  • connection (type: GoogleApi.AdSense.V14.Connection.t) - Connection to server
  • start_date (type: String.t) - Start of the date range to report on in "YYYY-MM-DD" format, inclusive.
  • end_date (type: String.t) - End of the date range to report on in "YYYY-MM-DD" format, inclusive.
  • optional_params (type: keyword()) - Optional parameters

    • :alt (type: String.t) - Data format for the response.
    • :fields (type: String.t) - Selector specifying which fields to include in a partial response.
    • :key (type: String.t) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • :oauth_token (type: String.t) - OAuth 2.0 token for the current user.
    • :prettyPrint (type: boolean()) - Returns response with indentations and line breaks.
    • :quotaUser (type: String.t) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (type: String.t) - Deprecated. Please use quotaUser instead.
    • :accountId (type: list(String.t)) - Accounts upon which to report.
    • :currency (type: String.t) - Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set.
    • :dimension (type: list(String.t)) - Dimensions to base the report on.
    • :filter (type: list(String.t)) - Filters to be run on the report.
    • :locale (type: String.t) - Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
    • :maxResults (type: integer()) - The maximum number of rows of report data to return.
    • :metric (type: list(String.t)) - Numeric columns to include in the report.
    • :sort (type: list(String.t)) - The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending.
    • :startIndex (type: integer()) - Index of the first row of report data to return.
    • :useTimezoneReporting (type: boolean()) - Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used.
  • opts (type: keyword()) - Call options

Returns

  • {:ok, %GoogleApi.AdSense.V14.Model.AdsenseReportsGenerateResponse{}} on success
  • {:error, info} on failure
Link to this function

adsense_reports_saved_generate(connection, saved_report_id, optional_params \\ [], opts \\ []) View Source
adsense_reports_saved_generate(
  Tesla.Env.client(),
  String.t(),
  keyword(),
  keyword()
) ::
  {:ok, GoogleApi.AdSense.V14.Model.AdsenseReportsGenerateResponse.t()}
  | {:error, Tesla.Env.t()}

Generate an AdSense report based on the saved report ID sent in the query parameters.

Parameters

  • connection (type: GoogleApi.AdSense.V14.Connection.t) - Connection to server
  • saved_report_id (type: String.t) - The saved report to retrieve.
  • optional_params (type: keyword()) - Optional parameters

    • :alt (type: String.t) - Data format for the response.
    • :fields (type: String.t) - Selector specifying which fields to include in a partial response.
    • :key (type: String.t) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • :oauth_token (type: String.t) - OAuth 2.0 token for the current user.
    • :prettyPrint (type: boolean()) - Returns response with indentations and line breaks.
    • :quotaUser (type: String.t) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (type: String.t) - Deprecated. Please use quotaUser instead.
    • :locale (type: String.t) - Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified.
    • :maxResults (type: integer()) - The maximum number of rows of report data to return.
    • :startIndex (type: integer()) - Index of the first row of report data to return.
  • opts (type: keyword()) - Call options

Returns

  • {:ok, %GoogleApi.AdSense.V14.Model.AdsenseReportsGenerateResponse{}} on success
  • {:error, info} on failure
Link to this function

adsense_reports_saved_list(connection, optional_params \\ [], opts \\ []) View Source
adsense_reports_saved_list(Tesla.Env.client(), keyword(), keyword()) ::
  {:ok, GoogleApi.AdSense.V14.Model.SavedReports.t()} | {:error, Tesla.Env.t()}

List all saved reports in this AdSense account.

Parameters

  • connection (type: GoogleApi.AdSense.V14.Connection.t) - Connection to server
  • optional_params (type: keyword()) - Optional parameters

    • :alt (type: String.t) - Data format for the response.
    • :fields (type: String.t) - Selector specifying which fields to include in a partial response.
    • :key (type: String.t) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • :oauth_token (type: String.t) - OAuth 2.0 token for the current user.
    • :prettyPrint (type: boolean()) - Returns response with indentations and line breaks.
    • :quotaUser (type: String.t) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (type: String.t) - Deprecated. Please use quotaUser instead.
    • :maxResults (type: integer()) - The maximum number of saved reports to include in the response, used for paging.
    • :pageToken (type: String.t) - A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response.
  • opts (type: keyword()) - Call options

Returns

  • {:ok, %GoogleApi.AdSense.V14.Model.SavedReports{}} on success
  • {:error, info} on failure