Search code examples
analyticsgoogle-analytics-api

Custom metadata with event request


I'm firing off various events from my site to GA, and I want to be able to include arbitrary metadata with those requests so that i can retrieve the events later and group them by various categories. I unfortunately cannot fit this data into the Category/Action/Label setup they have currently. I am, for example, passing in a noninteractive flag, and I was wondering if there is a way to send arbitrary flags in the same way as this is done?


Solution

  • I think custom dimensions and custom metrics are what you're looking for. If you're using the most recent version of GA (analytics.js), there's more info here: https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets

    Assuming you want to count the number of instances of something (clicks on a button, let's say), you'd set the custom metric value to 1.

    If you give more detail around what exactly you want to track and what shape you need the data in, I could give you more help.

    Thanks, Tom