Sitelet https://github.com/googleapis/google-cloud-ruby/issues/22484
Skip to content

Circular dependency found for dimension for google-analytics-data #22484

Description

@ueiu

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS: macOS 10.15.6
  • Ruby version: 2.6.5
  • Gem name and version: google-analytics-data (0.4.0)

Steps to reproduce

I am using the google-analytics-data gem to retrieve Google Analytics reports. When I try to convert the value of 'searchTerm' to lowercase, I encountered the following error. I referred to this document: CaseExpression Could you please let me know if this attribute is not supported?

Code example

credentials_path = 'sample.json'

client = Google::Analytics::Data.analytics_data { |config| config.credentials = credentials_path }

view_id = 'properties/xxxxxxxx'

dimension_filters = []
    dimension_filters << Google::Analytics::Data::V1beta::Filter.new(
      field_name: 'searchTerm',
      string_filter: Google::Analytics::Data::V1beta::Filter::StringFilter.new(
        value: "^.+$",
        match_type: Google::Analytics::Data::V1beta::Filter::StringFilter::MatchType::FULL_REGEXP
      )
    )
    filter_expression = Google::Analytics::Data::V1beta::FilterExpression.new(
      and_group: Google::Analytics::Data::V1beta::FilterExpressionList.new(
        expressions: dimension_filters.map{|filter| {filter: filter}},
      )
    )

request = Google::Analytics::Data::V1beta::RunReportRequest.new(
      property: view_id,
      dimensions: [
        Google::Analytics::Data::V1beta::Dimension.new(
          name: 'searchTerm',
          dimension_expression: Google::Analytics::Data::V1beta::DimensionExpression.new(
            lower_case: Google::Analytics::Data::V1beta::DimensionExpression::CaseExpression.new(dimension_name: 'searchTerm')
          )
        ),
        Google::Analytics::Data::V1beta::Dimension.new(name: 'pagePath'),
      ],
      date_ranges: [
        Google::Analytics::Data::V1beta::DateRange.new(start_date: 'yesterday', end_date: 'yesterday')
      ],
      dimension_filter: filter_expression
    )
r = client.run_report(request)

Full backtrace

Google::Cloud::InvalidArgumentError: 3:Circular dependency found for dimension: searchTerm. debug_error_string:{"created":"@1688623183.696165000","description":"Error received from peer ipv4:127.0.0.1:7890","file":"src/core/lib/surface/call.cc","file_line":906,"grpc_message":"Circular dependency found for dimension: searchTerm","grpc_status":3}

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionRequest for information or clarification. Not an issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions