How to Track PDF Opens and Reading Activity with Google Analytics
Question details
The user wants to understand if it is possible to embed a Google Analytics link within a PDF to track when users open the file and monitor their reading activity.

- Product
- Device & OS
- not provided
- Scenario
- Distributing PDF documents to an audience and attempting to gather analytics on viewer engagement, such as open rates and page views.
- Observed behavior
- Standard PDF hyperlinks and embedded tracking scripts do not reliably report analytics data because most offline or third-party PDF viewers disable JavaScript and external data connections.
Before implementing PDF tracking, ensure you have access to your website's source code or hosting environment, as reliable analytics require hosting the PDF online rather than sending it as an offline attachment.
Host the PDF on a Web Page Using a PDF Embed API
The most reliable way to track reading activity is to embed the PDF into a webpage using a dedicated PDF API that supports analytics integration.
Because standalone PDF readers (like desktop applications or basic browser plugins) often block JavaScript, direct Google Analytics integration inside the file will fail. By embedding the PDF on a webpage you control, you can use API event listeners to track how users interact with the document.
Using tools like the Adobe PDF Embed API allows you to monitor page views, scrolling behavior, and time spent on each page. These specific reader events can then be forwarded to your Google Analytics property.
Create a dedicated HTML page on your website where the PDF document will be hosted.
Generate an API key for a service like Adobe PDF Embed API and insert the provided JavaScript integration code into your web page.
Add JavaScript to your site to listen for PDF interactions (e.g., page views, zoom, scroll) triggered by the API.
Map the gathered PDF events to your Google Analytics (GA4) property using standard gtag.js event tracking codes.

Track PDF Button Clicks and Downloads via Your Website
If you only need to know how many times a PDF was opened or downloaded from your site, you can track the link clicks using Google Tag Manager.
Track PDF Views Easily with WPS Office Cloud Sharing
Setting up Google Analytics for PDFs requires web development knowledge and external APIs. With WPS Office, you can bypass this complexity by uploading your PDF to the WPS Cloud and sharing it via a secure link. The built-in cloud system automatically tracks how many times your document link has been viewed, giving you instant engagement metrics.
- 1. Open your PDF in WPS Office: Launch WPS Office on your computer or mobile device and open the PDF document you want to share and track.
- 2. Upload to WPS Cloud: Save the document to your WPS Cloud drive to enable link generation.
- 3. Create a Sharing Link: Click the 'Share' button in the top right corner of the application and generate a view-only link.
- 4. Monitor Link Views: Check your WPS Cloud dashboard or the document's share settings to see the total number of times your shared PDF link has been opened.

Frequently Asked Questions
Why doesn't inserting a Google Analytics tracking pixel into a PDF work?
Modern PDF viewers are designed with strict security sandboxes. They block external resources, such as invisible tracking pixels and embedded JavaScript, preventing the PDF from sending a signal to Google Analytics when opened.
Can I track offline PDF reading activity?
No. Analytics tracking fundamentally requires an active internet connection to ping the tracking servers. If a user downloads your PDF to their local device and reads it completely offline, no data can be transmitted.
Is there any way to know exactly who opened my PDF?
Standard offline PDFs cannot identify individual users. To track specific users by name or email, you would need to host the PDF behind a secure login portal on your website or use specialized document tracking software that requires an email address to view the file.




