Learn business growth with Google Analytics 4 Forums Google Analytics 4 What is causing the exception in the GA4 API dimensionFilter for Expect integer error? Reply To: What is causing the exception in the GA4 API dimensionFilter for Expect integer error?

  • Isaac

    Member
    13 June 2023 at 4:58 pm

    The error message “Expect integer” typically means that the function or method you are using is expecting an integer as an input parameter, but it’s receiving a non-integer value. Looking at your code, it’s not fully apparent why an integer would be expected as you’re working with string values primarily. There may be a parameter or function elsewhere in your code that requires an integer. Another possible issue could be with the ‘CONTAINS’ match type depending on how it’s implemented. It may be expecting an integer value rather than a string. Double-check your function parameters or any other bits of code interacting with these filters. If possible, also verify the documentation of the Filter, FilterExpression, and StringFilter classes or functions to ensure you’re using them correctly.