We target is to view conversion reports based on traffic source, but google analytics show me only macro sources of traffic - like Facebook, Youtube, direct and so on. But i need more details. I give different links to different facebook communities, for example: https://imbahase.com/?c=facebook_community1 or https://imbahase.com/?c=facebook_community2

If user registers on my site i save his refferal code(facebook_community1, facebook_community2 and so on) to my database.

The problem i met is that i need to view conversion reports filtered by referral code, to decide which publics converts better then another. How should i pass this data to google, and how to build reports i descrived higher?

I am currently using google tag manager and google analytics


Actually my tracking code is nearly same as campaigns in google analytics, so all i need is to get query string and do smth like

ga('set', 'campaignName', trackingCode);
ga('set', 'campaignSource', trackingCode);
ga('set', 'campaignMedium', trackingCode);

1 Answer 1


What you'll want to do is register this as a custom dimension when the pageview is captured.

You have two options:

  1. Use Google Tag Manager, and a Macro to capture the query string. When you fire the UA Pageview tag - add this captured variable into the Custom Dimension box.
  2. Using JavaScript to capture the querystring from the url (http://gomakethings.com/how-to-get-the-value-of-a-querystring-with-native-javascript/) you can send it with your pageview like this:

    ga('send', 'pageview', {'dimension1': query_string});


Your Answer

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

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