Postgres: Subquery with GROUP BY
Was solved using window functions, like:

SELECT e.*
FROM (SELECT e.pageview_identifier,
             e.created_at,
             e.pageview_current_url,
             e.pageview_mobile,
             e.event_type,
             COUNT(*) FILTER (WHERE e.event_type = 'mouse:move') OVER (PARTITION BY e.company_identifier, e.user_identifier, e.pageview_identifier) as cnt_mouse_move,
             ...
      FROM events e
      WHERE e.company_identifier = 'xyz' AND
          e.user_identifier = '01CDQZVSJFBDA8W444JS2CS3BA' 
     ) e
WHERE e.event_type = 'page:view';