文件
瀏覽文件

Add Privatus Analytics to Magento and Adobe Commerce

Add cookieless analytics to Magento or Adobe Commerce with the HTML Head scripts field in Design Configuration, and allow the script in your CSP.

以 Markdown 檢視
  1. In the Admin go to Content → Design → Configuration.
  2. Find your store view, click Edit in the Action column and expand HTML Head.
  3. Paste the snippet into Scripts and Style Sheets:
html
   <script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage,auto,vitals,clicks,ask"></script>
  1. Click Save Configuration.

Adobe's page setup docs describe the field as the place for scripts that load before the closing </head> tag. Settings can differ per store view, so repeat the steps for each view you want to count.

Content Security Policy#

Adobe says all JavaScript entered in Scripts and Style Sheets must be allowed by your Content Security Policy, or it does not run on the checkout pages. Add your tracker host (privatusstats.com) to the script-src and connect-src directives your store sends.

Full page cache#

Flush the Magento cache after you save so the snippet appears on cached pages. See also Caching plugins.