Learn business growth with Google Analytics 4 Forums Google Analytics 4 Analyzing Brand Occurrences and Event Counts in GA4 with BigQuery Reply To: Analyzing Brand Occurrences and Event Counts in GA4 with BigQuery

  • Emma

    Member
    23 April 2023 at 10:53 pm

    I see what’s going on here. The subquery is causing an issue because it’s possible that unnesting the array ‘items’ might get more than one item and trying to transform these into a scalar (a single value) is causing the issue. You’re asking it to get an ‘item_brand’ but it gets multiple possible hits for it which confuses it.

    By inserting LIMIT 1, you’re essentially telling your query to just pick one brand out of possibly multiple ones it finds, thereby avoiding the ‘more than one element’ problem.

    So your edited query tells BigQuery to “get the event_date, event_name, and one (any) brand for each cart added event”. This should work for you, as it limits the item_brand output to only one per event. Hope this helps!