First count, then implode.
Merge pull request #1853 from kaltura/IX-9.19.7-live-analytics

First count, then implode.