Learn business growth with Google Analytics 4 Forums Google Analytics 4 Extract Daily Ad Revenue from GA4-linked BigQuery Using Query Language Reply To: Extract Daily Ad Revenue from GA4-linked BigQuery Using Query Language

  • Elijah

    Member
    29 June 2023 at 10:49 pm

    In Google Analytics 4 (GA4), ad revenue can be associated with multiple event names depending on the attribution system you’re using. However, two most common events where you’ll likely see ad revenue are “ad_impression” and “ad_click”. If you wish to sum up the ad revenue for each day, you need to locate the ad_revenue event parameter for these events.

    Here’s a simple BigQuery query that might help:

    `
    SELECT
    event_date,
    SUM(event_params.value.double_value) as total_ad_revenue
    FROM
    your-project.dataset.events,
    UNNEST(event_params) AS event_params
    WHERE
    event_params.key = “ad_revenue”
    GROUP BY
    event_date
    ORDER BY
    event_date DESC
    `

    Regarding the LTV (Lifetime Value) Revenue returning NULL, it might be due to the fact that LTV metrics are not pre-aggregated or calculated in the raw event data that’s exported to BigQuery from GA4. The calculation and population of user-level LTV metrics usually happen within the Google Analytics interface, which means it might not be directly available in the BigQuery dataset.