2

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?

1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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