https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
a

alert-state-22242

12/19/2023, 11:19 AM
How should I process the "meta" array of objects. Since GA4 cant process objects? What I've done now is to JSON-stringify it with this code:
Copy code
function() {
  var obj = {{DLV - experiment_results.experiment.meta}};
  return JSON.stringify(obj);
}
Making it show up like so in the debugView
Like so*
@fresh-football-47124 Do you know if you guys have any go to practice for this?
f

fresh-football-47124

12/20/2023, 5:50 PM
I'm a bit confused as to why you're passing this info to GA4?
a

alert-state-22242

12/22/2023, 7:28 AM
We are passing everything that comes with the API call. What data should we be passing to GA? This is our dL
Copy code
dataLayer.push({
  event: "experiment_results",
  results: [
    {
      experiment: {
        key: "prepaid-description",
        variations: [false, true],
        weights: [0.5, 0.5],
        active: true,
        coverage: 1,
        condition: null,
        namespace: null,
        force: null,
        hashAttribute: "id"
      },
      result: {
        inExperiment: true,
        variationId: 1,
        value: true,
        hashUsed: true,
        hashAttribute: "id",
        hashValue: "9759064.1701950960"
      }
    }
  ],
  eventTimeout: 2000,
  gtm.uniqueEventId: 142
})
f

fresh-football-47124

12/23/2023, 4:03 AM
I'm assuming you're using our SDK, in which case the trackingCallback should be used to track the experiment exposures
There are some examples of this for GA4 in our docs
3 Views