WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an easy way to filter between posts and pages in Google Analytics?

Page is listed as a Primary Dimension when I drill down to Content but I'm not sure if that includes posts as well.

share|improve this question
up vote 1 down vote accepted

It's not tracked by default.

Yoast's WordPress SEO plugin allows you to track post types (and categories and authors...) as a custom variable.

share|improve this answer
I guess I'm stuck at what Custom Variable (Key 1) would be – AlxVallejo Apr 19 '12 at 0:52
If I understand your question right, and you're trying to write your own custom variable, you want get_post_type(). – mrwweb Apr 19 '12 at 4:00
My question revolves around filtering posts and pages. Sure, the Yoast plugin will track post type as a custom variable, but the arguments for a custom variable are: gaq.push(['_setCustomVar', $slotNumber, $Category, $Value, $ScopeLevel ]); . Therefore, if I'm running a filter in Google Analytics based on the custom variable, what is the $Category I'm looking for? I would imagine it's something like "post_type" but I don't see any documentation on this. – AlxVallejo Apr 19 '12 at 14:10
The category is post_type. In the report, it's found in Audience > Demographics > Custom Variables. – mrwweb Apr 19 '12 at 15:32
Didn't see that, thanks! It's a shame you can't drill down from post_type to see what the actual page was. – AlxVallejo Apr 19 '12 at 16:40

Page in Google Analytics is simply the webpage. You can do a search for your category slug to drill down posts and post categories. That's how I do it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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