Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

211
Views
google analytics ga4, users possibly being double counted?

I'm guessing the Referral metric in Google Analytics increments when the url has a ref in it (coming from a different site such as https://website.com?ref=facebook), but if the user clicks on a separate page and the ref param is dropped from the url, does that increment the Direct metric?

Just want to make sure users aren't being double counted since just yesterday the Referral and Direct metric were the same which was odd. If that is the case, is there a way to make sure they are not double counted?

google analytics

Using ga4

gtag.js

export const GA_TRACKING_ID = process.env.NEXT_PUBLIC_GA_ID;

export const pageview = (url) => {
  window.gtag("config", GA_TRACKING_ID, {
    page_path: url,
  });
};

export const event = ({ action, category, label, value }) => {
  window.gtag("event", action, {
    event_category: category,
    event_label: label,
    value,
  });
};

_app.tsx in NextJS app

  const router = useRouter();
  useEffect(() => {
    const handleRouteChange = () => {
      gtag.pageview(window.location.href);
    };
    router.events.on("routeChangeComplete", handleRouteChange);
    router.events.on("hashChangeComplete", handleRouteChange);
    return () => {
      router.events.off("routeChangeComplete", handleRouteChange);
      router.events.off("hashChangeComplete", handleRouteChange);
    };
  }, [router.events]);

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!