A building supplier offers a public installation guide in two places. The product page links to /files/pergola-guide.pdf. A trade portal has a button labelled “Get the same guide” pointing to /downloads/latest-guide/. Clicking either can open the same PDF, but the browser exposes different signals. A report that counts only the first route will make one placement look much better than it is.
Decide what the business means by “download”. A click shows demand. A request in the file server's logs shows the server saw a request. Successfully opening, saving or reading the document is a different outcome. This recipe measures activation of an approved public document link. It also explains where to look if actual delivery is the important part of the service.
Start with the href the browser can see
Inspect the rendered links, including the link underneath any icon. Record the original address, whether it is public, how it resolves and whether it opens another tab. Use a small test set covering a direct file, an extensionless route and an ordinary HTML page. If the site contains contracts, invoices or customer-specific files, leave those out of the sample. Signed download links can carry credentials or identifiers even when their labels seem harmless.
GA4 enhanced measurement can automatically emit file_download when a visitor clicks a link whose address has a recognised extension. PDF is one of those types. The event can carry file and link parameters, including file name, extension and link URL. Check the exact supported types in Google's table rather than treating every link with a “Download” label as eligible. Google’s enhanced measurement definitions
Open the relevant GA4 web stream under Admin → Data streams, inspect Enhanced measurement and check File downloads. Review whether another GTM tag, plugin or document system already sends equivalent events. In a permitted debug session, follow the public direct link once and inspect the receiver. Look for one file_download describing the correct document. A link opening the PDF in a browser tab can still generate the click event even though no one chose “Save as”.
Choose coverage for the extensionless route
The page's GTM listener sees the URL the visitor clicked. A redirect target or eventual response with a PDF content type is a later step. Test the automatic event on the real extensionless route. If it produces no file event, you have found a coverage difference, not a failing file server.
Keep automatic measurement for direct public file links if it works. For this guide, add a separate event only for the stable extensionless route. For example, give the anchor an ID of trade-guide-handoff. In GTM enable Click ID and Click URL, choose Just Links → Some Link Clicks, and match the approved ID and exact, stable route. Use a GTM URL variable reading the path from Click URL if you need to compare just the path. If the same ID could exist on another host, scope the origin too. Google’s link-click trigger guide
In Tags → New → Google Analytics: GA4 Event, use the intended stream and an explicit event such as public_guide_request. Set a safe parameter like resource_key=pergola_installation. Attach only the hand-off trigger. Give analysts a written definition and tell them which event represents each route. Alternatively, if the business requires one comparable event across all known public resources, implement one controlled allowlist and give that custom series sole ownership of the report. Address automatic collection and any privacy implications deliberately before disabling a whole stream feature.
For generated files, login-only links or document portals you don't control, generic click matching may be the wrong layer. Ask the owner for a documented “file prepared” or “delivery accepted” signal with an approved resource category. A system that must prove a paid document was delivered should maintain its own delivery record. Event counts in a browser can be missing for normal reasons such as consent or content blocking.
Test four actions that expose a misleading report
| Staging action | Automatic direct-link measure | Explicit hand-off measure | What you know |
|---|---|---|---|
| Click the public PDF once | One file_download when supported and enabled |
None | Visitor activated the direct link |
| Click the extensionless guide link once | Check actual behaviour; in our example, none | One public_guide_request |
Visitor started the hand-off |
| Open a normal HTML guide | None | None | It was a page visit |
| Click a test PDF link deliberately returning 404 | A file-click event can still occur | None for an unrelated route | A click alone cannot prove successful delivery |
Use a staging fixture for the 404. Never break a live client download to test its tracking. For the two successful paths, check the document opens separately from checking the analytics receiver. If both events fire on the extensionless path, revisit which sender should own that measurement before trusting totals. If neither fires, select the actual action in Tag Assistant and check whether the button is a link, a scripted download or an element inside another origin's iframe.
Try clicking the same direct PDF twice. Two event occurrences can be correct. A reader comparing popularity may prefer users or sessions, while an operations team examining load will need a different denominator. File servers may receive several requests while a viewer fetches ranges of one document. Browser caching and direct arrivals from search can further separate server counts from recorded clicks.
Keep private link data out of the handover
Send only a safe document category if that answers the question. Inspect page location, page title and automatic link parameters as well. A custom tag that emits just resource_key cannot clean up a token collected by somebody else's tag. For sensitive documents, review whether those surfaces should participate in automatic collection at all. Use synthetic sample URLs in previews and crop screenshots to the minimum evidence.
Record the two tested hrefs, event names, GA4 destination and the date the scope changed. The supplier can now answer “Which installation-guide placement attracted more clicks?” It will still check its delivery service or support records when a contractor says the PDF never arrived. For the receiver-side test, use the GA4 DebugView guide.