Search code examples
google-analyticsgoogle-analytics-apireferrals

Tracking an event to a referrer in Google Analytics


A site I'm working on is tracking Google Analytics events that always have a direct referral URL that is internal to our site. What would be good practice to link the event to the originating referral URL?

An example use case is:

User is on facebook -> Click through to our site -> Pageview -> Pageview -> EVENT

In this case the referral is considered direct but the traffic originated from facebook.

How do I make sure that the event's referrer is facebook in this case? So that when I look at goal conversion rates for my event, site visits that began with a referral from facebook and end in my event will count as goal conversions? And that this works for any referrer?


Solution

  • This can be achieved using a Custom Report.

    Here is a template to get you started. Simply load this URL when you have Google Analytics open: https://www.google.com/analytics/web/template?uid=TGYsmF8ZT8Cthzq-9We9Yg

    In a nutshell, I've defined the metric as unique events (that's what will be measured), and added Event Action as the default dimension. You can also filter by a specific Event, and add other Event data (label, category, value) as secondary dimensions.

    Hope this helps!