Search code examples
phpgoogle-analyticsoauth-2.0google-analytics-api

How to get data from Google analytic API based in utm_source and utm_medium?


I successfully integrated Google Analytic API for my site. But Now I want my Analytics result based on utm_source and utm_medium. I didn't found any Dimensions, metrics and filters for UTM.


Solution

  • The UTM acronym is a holdover from the Urchin days - UTM stands for Urchin Traffic Monitor. Google hasn't changed it because there are millions of links tagged with UTM parameters floating around on the interwebs.

    These parameters are also known as "Campaign Parameters"...but are also referred to as "Traffic Sources." The API variables you want to use are in the Traffic Sources section:

    ga:source

    ga:medium

    https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=traffic_sources