Query to find the count of page views and unique page views

Hi, I am trying to fetch the pageviews and unique pageviews count using query.

create or replace view pageview as (SELECT count(*) pv FROM matomo.matomo_log_link_visit_action where idsite=2 and idaction_event_action is null and server_time BETWEEN '2020-06-02 00:00:00' AND '2020-06-02 23:59:59' group by idaction_url);
select sum(pv) from pageview;

This gives the same result as in visits overview page for the site with minimal traffic. But the count obtained from the query differs for the site with high traffic.
We have used only tag manager code and I have considered the rows whose idaction_event_action field is null as a pageview since that field will hold value only for Events.
Is there any other logic i have missed out? (P.s I dont want the value from the API. ) Thanks in advance