Webmasters Stack Exchange is a question and answer site for pro webmasters. 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

We have the two custom variables on our WordPress site:

_gaq.push(['_setCustomVar', 1, 'pubDate', 'June 6, 2014']);
_gaq.push(['_setCustomVar', 2, 'author', 'Sam']);

The first variable is the date that the post was published.

How do we search for all posts between two dates using this value? Is this possible?

share|improve this question

Sorry, but you cannot filter between dates like that. The filter reference is here. There is one way however to do what you are trying to do. I'm afraid it will only work for the future though. You need to change your custom dimension ( or add a new one) and convert the date into an EPOCH timestamp. That is the number of seconds since Jan 1, 1970 in seconds, i.e. a number. When it is a number you can then filter in your query by converting your query dates into epoch stamps and then using the ga:customVar1>=1457470303 filter syntax in your query.

share|improve this answer

Your Answer

 
discard

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.