Use the following data layer variables to access data about the number of posts shown on a taxonomy or category page and the total number of items in the taxonomy. With the following data layer variables you will be able to access post count in Google Tag Manager.
This variable will include the number of posts shown on the current page. This will be a number that is lower or equals to the numbers of posts per page in the settings of WordPress.
This variable will include the number of posts shown in the current taxonomy on all pages of it. Use this to track empty taxonomy pages so that you can make sure every content is visible that has to be public.