简体   繁体   中英

Google Analytics Custom Parameter Name

I want to track if page views come from navbar, header, footer, etc. The Google Analytics parameters are long and annoying. Does Google Analytics support custom GET parameter names?
For example the url:

example.com/login?utm_source=navbar&utm_medium=local-click&utm_campaign=referer

Could be

example.com/login?ref=nav

Any ideas?

You could use Campaign Data Import . Simply upload a file which maps one value to many, for example ga:campaignCode to ga:medium,ga:source,ga:dimension1 and in your tracking code simply set the campaignId from your ref=nav.

// Create the tracker.
ga('create', 'UA-XXXX-Y', 'auto');

// Set the campaign code/id directly.
ga('set', 'campaignId', '1234');

// Send the page view.
ga('send', 'pageview');

In fact there is a good example of using url parameters to set values on tracker by using plugins along side of analytics.js.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM