Jason Robinson
Jason Robinson

Reputation: 31283

Setting up Google Analytics for Android using filters

I'm implementing Google Analytics for Android on an Analytics account that already tracks a website. What I want to do is set up a profile on the same account and have my Android app report to that profile and that profile only so that I can see analytics separately between the website and the app.

So I've made a new profile and set up two filters with the following attributes:

Filter Type: Exclude

Filter Field: User Defined

Filter Pattern: mobile_app=android

Case Sensitive: No

Applied to website profile

And the second

Filter Type: Include

Filter Field: User Defined

Filter Pattern: mobile_app=android

Case Sensitive: No

Applied to Android profile

On my Android app, I made a custom variable on application start like so:

GoogleAnalyticsTracker.getInstance().setCustomVar( 0, "mobile_app", "android", 3 );

I sent a few test events out and waited a day to see the results. When the analytics updated, my test events showed up in both profiles, and my Android profile was receiving analytics from the website. When I looked for user defined values under Visitors > User Defined, the only value was "(not set)". So am I doing something fundamentally wrong here?

Thanks for any input.

Upvotes: 1

Views: 1783

Answers (2)

Marcos Labad
Marcos Labad

Reputation: 1191

You can accomplish the task just adding a Custom filter like this one:

  • Custom Filter
  • Include
  • Filter Field: Operating system platform
  • File Pattern: Android

And of course, set the profile view to be a mobile one, not a website one, when creating it.

Upvotes: 3

Open SEO
Open SEO

Reputation: 1712

"User Defined" is an old type of variable that used to exist in Urchin, the product on which GA is based on. But "User Defined" is different from "CustomVar", and in fact you can't filter on CustomVar.

Why do you want to use the same webproperty ID for both apps ?

Upvotes: 1

Related Questions