Search code examples
facebookgoogle-analyticsgoogle-analytics-apifacebook-canvas

How to track 2 different google analytic profiles (main and test) under the same account and property name?


I am using google analytics event tracking to track 2 Facebook canvas application. (they are similar just that one is for production and another is for development). Since they are 2 separate canvas application, both have a different canvas url.

Below is how I setup google analytics:

Property Name : Sample

  1. Main profile (production)
  2. Test profile (development)

Both profiles have the same Tracking ID. How can I track them separately? Do I need to create filters? I am not sure but I might be setting this up wrongly. Do I need to create a separate property name instead?

Appreciate any advice.


Solution

  • Yes, you need to create two separate filters. One that includes pages from your production domain or url, and one for your development domain or url.

    Go to

    Admin > [all accounts if you have more than one account linked to your GA account] > accounts > [click on specified account] > Filters > New Filter

    Filter 1: (development)

    Name your filter something descriptive like "production".

    If the (sub)domains for your dev vs. prod are different, from the radio buttons/dropdowns, pick

    predefined > include only > that are equal to > "dev.yoursite.com" or whatever your dev (sub)domain is.

    If the (sub)domains for dev vs prod are the same (but different directory path, pick

    predefined > include only > traffic to the subdirectories > that starts with > "path/to/dev/"

    highlight the dev profile and click the add button to bring it over to the selected profiles. Click "Save" and you are done with the "development" filter. Now wash rinse and repeat but for your production profile.

    With this setup, only data specific to the (sub)domain or directory path will go to your profiles. NOTE: This is not retroactive, any data GA received before you created the filters (even if the data is still in queue and hasn't actually shown up in reports yet) will still show up in your profiles.