1

I'm looking for some general advice. The site I'm currently working on is full of duplicate content that's about to be deduplicated. But it was built that way to track different audiences visiting the pages by reporting on the URL hits.

Current Links

  • www.MySite.com/homeowner/painting
  • www.MySite.com/professional/painting
  • www.MySite.com/designer/painting

My concern is that at the end of the day, the person managing the analytics wants to be able to look at their report and say "We had X number of professionals visit the site." Simply deduping will elimate that.

I'm thinking Google Analytics might have a way to pass audience/tags in via the URL like this:

Example Links with Tracking

  • www.MySite.com/painting?tag=homeowner
  • www.MySite.com/painting?tag=professional
  • www.MySite.com/painting?tag=designer

Is this possible with Google Analytics? Does anyone have an example website using this?

I've looked into Custom Dimensions and Metrics but they seem to be overkill https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets

1

1 Answer 1

2

Yes, of course. You can setup a custom dimension depending on tag parameter in URL.

How it could be coded? Getting value of tag param and sending to analytics

function visitor(key_str) {
if(window.location.search) {
var query = window.location.search.substr(1);
ga('send', 'pageview', {
'audience':  query
});
}}

Remember that custom dimension need to be preconfigured (set before) in Google Analytics administration panel.

https://support.google.com/analytics/answer/2709829?hl=en https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.