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?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.