How can I manually set a field in Universal Analytics?

by Vecta   Last Updated September 12, 2019 19:04 PM

I need to set some field data for Analytics manually in a certain situation. In my JS I have the following:

ga(function(tracker) {
   tracker.set('campaignKeyword', 'my keyword');
   tracker.send('event');
});

But I can't seem to see anything come through in Analytics.

I've run console.log(tracker) and it's a valid Universal Analytics tracking object — I'm just not sure what I'm doing wrong. I've been referencing this documentation.

What am I missing?



Related Questions


Updated October 10, 2017 09:04 AM

Updated March 08, 2018 19:04 PM

Updated June 21, 2017 17:04 PM

Updated February 06, 2019 15:04 PM

Updated June 27, 2018 11:04 AM