Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Analytics
English French
English French

How do I tag a PWA (Progressive Web App)?

Since Google's Progressive Web Apps (PWA) are HTML5 interfaces that support JavaScript, like all classic websites, the recommended approach is to use thee Piano Analytics Developers documentation.

Note that if you require assistance at any point in your tagging process, we offer a dedicated consulting service whereby a consultant will provide you with everything you need either on-site or remotely to make the implementation a success. If this option interests you please contact your Sales representative or the Support Centre for more information.

Implementation Steps

1. Add the Piano Analytics JavaScript SDK

Include the universal SDK script on your PWA pages:

HTML
<script type="text/javascript" crossorigin="anonymous" src="https://tag.aticdn.net/piano-analytics.js"></script>

2. Configure your site

Set up your site ID and collection domain:

pa.setConfigurations({
    site: <your_site_id>,
    collectDomain: "https://<your_collect_domain>.pa-cd.com"
    });

3. Send Events

Track page views using:

pa.sendEvent("page.display", {
    page: "Page name",
    page_premium: false,
    page_authors: ["Author1", "Author2"]
});

Differentiating PWA Traffic from Regular Web Traffic

Since the platform does not automatically detect whether traffic comes from a PWA or a standard website, it's recommended to:

  • Create a custom property in your Data Model to flag the source (e.g., assigning values like "PWA" or "Web" based on the origin of the hit).

  • This differentiation must be handled within your tagging setup so you can segment and analyze PWA traffic separately in your reports.

Last updated: