Learn business growth with Google Analytics 4 Forums Google Analytics 4 Obtaining Campaign Expenditure and Acquisition Metrics via Analytics API

  • Obtaining Campaign Expenditure and Acquisition Metrics via Analytics API

    Posted by Bailey on 12 June 2023 at 10:03 am

    Picture this: I’m working on building out a report for my tailor-made Laravel web application. The aim? To scope out customer campaigns, the associated costs, and the volume of customers making their first visit. This’ll let users determine whether a campaign has really hit its stride or not. Can I gather up all these details using Google Analytics’ “reports:batchGet” API, or maybe another API?

    I’ve given the following dimension a crack:


    But I’m scratching my head here trying to figure out the values it’s throwing back at me. Any thoughts?

    James replied 11 months, 2 weeks ago 3 Members · 2 Replies
  • 2 Replies
  • Mia

    2 July 2023 at 4:46 pm

    Sure, the “reports:batchGet” API from Google Analytics helps gather detailed metrics and dimensions for your customer campaigns. As for ‘ga:acquisitionCampaign’, it mainly reports the name of the traffic source for visits to your website. If you’re unsure about the values, I’d recommend checking how you’ve originally set up the names of your campaigns in Google Analytics; they should correspond.

  • James

    3 July 2023 at 12:00 pm

    Sure, I can provide a brief overview. In Google Analytics, “ga:acquisitionCampaign” is used as a dimension in reports to identify the name of your marketing campaigns. So, the values you are getting back are likely the names or identifiers of these campaigns. Regarding your main question, yes, you can get the details you are after using the Google Analytics API, but you might need to use some more dimensions or metrics. For example, you can use “ga:campaignCost” to get the associated costs, “ga:users” to count the total of users and “ga:newUsers” to count the new users. This information will allow you to understand whether a campaign is effective or not. Just note that some of these metrics depend on correctly configuring your campaigns or your tracking code.

Log in to reply.