Edwin Evans
Edwin Evans

Reputation: 2836

Google analytics parameter not working

I'm trying to set my Medium in google analytics javacript. I'm doing:

ga('create', googleAnalyticsId, 'auto');
ga('set', 'campaignMedium', 'organic');
console.log(ga.q);
ga('send', 'pageview', '/testing');

But when I look in Google Analytics Real-Time (or regular views) the Medium is shown as "(none)". What am I doing wrong?

Upvotes: 1

Views: 165

Answers (1)

Eike Pierstorff
Eike Pierstorff

Reputation: 32760

It seems you cannot set the campaignMedium alone - I tested this, and only got it working after I set both campaignMedium and campaignSource. So:

ga('create', googleAnalyticsId, 'auto');
ga('set', 'campaignMedium', 'organic');
ga('set', 'campaignSource', 'Gnugle');
ga('send', 'pageview', '/testing');

Actually reported organic/Gnugle in the realtime report.

Upvotes: 3

Related Questions