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

155
Views
Can I freeze/unfreeze Google Analytics on a page via JavaScript?

I have a Swift app with a section that contains a feed of articles. Each article is presented as a web view baked into the app.

The web views are each loaded as the links in the feed are shown, i.e. before the actual view of the article is presented.

I have noticed that Google Analytics considers these preloads to be page views. How can I avoid this? I am able to run JavaScript at the time of the preload as well as when the user navigates to the article. Is it possible to use custom JavaScript to stop GA when the page first loads, then re-enable it when the page is actually displayed?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is not guaranteed to work but one thing you could explore, providing that you own the GA implementation and the actual articles is to filter out traffic in GA based on a query string param or a campaign param, OR to use some javascript in the articles pages to prevent the GA script from executing.

In your app, upon fetching the list of articles you would append all the URLs in the webviews with a param=value that you would use to build an exclusion rule in the property/view settings in the admin, or instruct your JS in the articles to not execute GA.

On the click on an article you would however remove the param from the URL which would cause GA to behave "normally".

From the GA console:

enter image description here

about 4 years ago · Juan Pablo Isaza Report
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!