Mobile app version of vmapp.org
Login or Join
Alves908

: "Publish date" custom variable in Google Analytics, how to search between two dates? We have the two custom variables on our WordPress site: _gaq.push(['_setCustomVar', 1, 'pubDate', 'June 6, 2014']);

@Alves908

Posted in: #Google #GoogleAnalytics #Wordpress

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme