Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ueiu opened this issue Jul 6, 2023 · 0 comments
Open

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

ueiu opened this issue Jul 6, 2023 · 0 comments
Labels
type: question Request for information or clarification. Not an issue.

Comments

@ueiu
Copy link

ueiu commented Jul 6, 2023

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!

@NivedhaSenthil NivedhaSenthil added the type: question Request for information or clarification. Not an issue. label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants