Mateusz Kozłowski
Mateusz Kozłowski

Reputation: 83

How to collect all network requests with GTM?

Is it possible to collect the names of all network requests that a site makes when it runs that are visible in browser's developer tools (for example scripts, html, etc.)? I would like to collect them with GTM tags and send them to GA as events.

Upvotes: 0

Views: 619

Answers (1)

darrelltw
darrelltw

Reputation: 2372

Yes there is a way to do it. Have a look at this document

But looks like you are using GA to collect something like log service.

There will be many challenge when you want to do this on GTM.

  1. The listener will fail for the requests before GTM loading.

  2. If the website traffic grows. It will reach the free version of GA very quickly.

  3. If the JS code goes wrong. It might affect the request loading then something will go wrong on the website.

So this requirement might define more clearly on why we want to do this. What kind of the request you want to track? Only the request from your server or 3rd party request like GA and other tracking request.

Upvotes: 1

Related Questions