{"id":4524,"date":"2020-08-03T10:00:02","date_gmt":"2020-08-03T07:00:02","guid":{"rendered":"https:\/\/trackingchef.com\/?p=4524"},"modified":"2020-12-14T15:19:28","modified_gmt":"2020-12-14T12:19:28","slug":"fixing-facebook-referrer-tracking-in-google-analytics","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/google-analytics\/fixing-facebook-referrer-tracking-in-google-analytics\/","title":{"rendered":"Fixing Facebook referrer tracking in Google Analytics"},"content":{"rendered":"\n

When trying to report on traffic from coming Facebook to your site, you can come across multiple instances of Facebook across several Source\/Medium rows.<\/p>\n\n\n\n

Most commonly, you can expect to see facebook.com<\/em>, m.facebook.com<\/em>, l.facebook.com<\/em> and lm.facebook.com<\/em>.<\/p>\n\n\n\n

\"\"
Multiple Facebook referrers in the Source\/Medium report<\/figcaption><\/figure><\/div>\n\n\n\n

This can be quite a pain in the neck when configuring your reports for Facebook traffic.<\/p>\n\n\n\n

Why does this happen?<\/h2>\n\n\n\n

Facebook sends traffic through two main domains based on the device the user is on – Desktop or Mobile. This is indicated by the letter M<\/strong> in the subdomain, i.e. m.facebook.com<\/em> and lm.facebook.com<\/em>.<\/p>\n\n\n\n

On top of that, Facebook uses a mechanism called Link Shim<\/a> that sends the user via a redirect before landing on your site. This adds the letter L<\/strong> to the subdomain, i.e. l.facebook.com<\/em> and lm.facebook.com<\/em>.<\/p>\n\n\n\n

This mechanism serves two purposes:<\/p>\n\n\n\n

  1. Protecting the user’s privacy – if the user clicked a link on their Facebook profile, the referral URL (Full Referrer) would show their profile link, which is personally identifiable information (PII)<\/li>
  2. Protecting the user from malicious links – Before sending the user to the external link, Facebook checks that the link is legit against a list of malicious sites built by Facebook, Google McAfee and others.<\/li><\/ol>\n\n\n\n

    How to solve this<\/h2>\n\n\n\n

    Solving this is pretty easy, by adding a simple ‘Search and Replace’ filter on your Google Analytics view.<\/p>\n\n\n\n

    1. Open Google Analytics and navigate to the admin section<\/li>
    2. Under the relevant view, click Filters and then ‘Add Filter’<\/li>
    3. Select ‘Create new Filter’<\/li>
    4. Name the filter something descriptive, e.g. ‘Facebook referrer rewrite’<\/li>
    5. Set the Filter Type to Custom<\/li>
    6. Select Search and Replace<\/li>
    7. Set the Filter Field to ‘Campaign Source’<\/li>
    8. Under ‘Search string’ paste ^.*.facebook.com<\/strong><\/em><\/li>
    9. Under ‘Replace string’ paste facebook.com<\/strong><\/em><\/li>
    10. Save the filter<\/li><\/ol>\n\n\n\n
      \"\"
      Facebook referrer rewrite filter<\/figcaption><\/figure><\/div>\n\n\n\n

      Pro tip:<\/strong>
      Always create a backup view for your property that doesn’t have any filters applied to it<\/p><\/blockquote>\n\n\n\n

      You can also verify your filter before saving to examine how the filter would have impacted your past seven days data. The table below shows the values impacted and the expected output of the filter.<\/p>\n\n\n\n

      \"\"
      Validating the filter<\/figcaption><\/figure><\/div>\n\n\n\n

      The bigger issue with Facebook tracking in Google Analytics<\/h2>\n\n\n\n

      The key issue with Facebook tracking in Google Analytics is the inability to distinguish between Paid and Organic traffic coming from Facebook. Google can’t tell apart these traffic types, so if you’re reporting on Paid Facebook campaigns using Google Analytics you could run into attribution issue.<\/p>\n\n\n\n

      The standard mechanism for solving this is by using UTMs in your Facebook ads, so that a user sent to your site from a campaign will be clearly marked for Google Analytics.<\/p>\n\n\n\n

      For example, a user will be sent to the link:<\/p>\n\n\n\n

      https:\/\/www.example.com\/product?utm_source=facebook&utm_medium=ppc&utm_campaign=summer-2020<\/p>\n\n\n\n

      \"\"
      Paid vs Organic Facebook traffic in Google Analytics<\/figcaption><\/figure><\/div>\n\n\n\n

      These UTMs can be added in Facebook in one of two ways:<\/p>\n\n\n\n

      1. Directly on the Website URL you’re sending the users to. You can use Facebook’s built in tool for that
        \"\"
        <\/li>
      2. You can also use the URL Parameters box to add these. Using this box makes the UTM management easier across the entire account.
        \"\"<\/li><\/ol>\n\n\n\n

        Using Facebook’s native UTM tool can also inject dynamic parameters from Facebook, e.g. the Campaign’s ID or the Ad Set’s name for more granular control at scale (although some might argue that these are notoriously error prone).<\/p>\n\n\n\n

        \"\"<\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"

        When trying to report on traffic from coming Facebook to your site, you can come across multiple instances of Facebook across several Source\/Medium rows. Most commonly, you can expect to see facebook.com, m.facebook.com, l.facebook.com and lm.facebook.com. This can be quite a pain in the neck when configuring your reports for Facebook traffic. Why does this […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2],"tags":[],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4524"}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=4524"}],"version-history":[{"count":13,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4524\/revisions"}],"predecessor-version":[{"id":4884,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4524\/revisions\/4884"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=4524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=4524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=4524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}