WordPress
Step-by-step guide to integrate Ours Privacy with WordPress for tracking page views and custom events in HIPAA-regulated workflows.
Install the Ours Privacy Web SDK on your WordPress website, track page views, and log custom events, with analytics built for HIPAA-regulated workflows.
Integration Options
The integration guide below covers using the Ours Privacy Web SDK.
For a no-code approach, we recommend the Ours Privacy Tag Manager, which provides visual tag management built for HIPAA-regulated sites.
Choose the approach that best suits your workflow.
Install
To integrate Ours Privacy with your WordPress website, you’ll need to install our tracking script. Follow these steps:
- Go to the Install Ours page in your Ours Privacy account.
- Copy the script provided on that page.
- Add the script to your WordPress site using one of these methods:
- Using a Plugin: We recommend using a plugin such as Insert Headers and Footers or Code Snippets.
- Paste the script into the Header section of the plugin settings.
- Directly in the Theme:
- Navigate to Appearance > Theme Editor in your WordPress admin dashboard.
- Open the
header.phpfile of your active theme. - Paste the script just before the closing
</head>tag.
- Using a Plugin: We recommend using a plugin such as Insert Headers and Footers or Code Snippets.
Save your changes and verify the script is included on all pages of your website.
Tracking Page Views
Page views are tracked for you. The install snippet enables automatic web event tracking, so the Web SDK records a page_view event on each page load without any additional code.
Note: Do not add your own
ours('track', 'PageView')call. It creates a second, redundant event alongside the automaticpage_view, which splits your page view reporting across two event names. If you added one previously, remove it.
For details on what else is captured automatically, see the Web SDK reference.
Track Events
To track custom events such as form submissions or button clicks, you can add the ours('track', ...) function in your WordPress code or using custom JavaScript. You can place this in the plugin settings (if using a plugin like Insert Headers and Footers) or directly within your site’s JavaScript files.
Example: Tracking Button Clicks
<button onclick="ours('track', 'ButtonClicked');">Contact Us</button>Example: Tracking Form Submissions
<form onsubmit="ours('track', 'FormSubmit');">
<input type="text" name="name" placeholder="Your Name" />
<button type="submit">Submit</button>
</form>Recommended Plugins
Here are some WordPress plugins that make it easy to add the Ours Privacy Web SDK and manage events:
- Insert Headers and Footers: A simple plugin for adding custom scripts to your site.
- Code Snippets: A versatile plugin for adding custom JavaScript and PHP snippets to your site.
Why Use Ours Privacy for WordPress?
Ours Privacy brings analytics built for HIPAA-regulated workflows to your WordPress site. Events route through Ours Privacy first, so you control what reaches third parties.
Key Benefits:
- Built for HIPAA-regulated workflows: Designed for healthcare and privacy-conscious organizations.
- Custom Event Flexibility: Easily track specific interactions like form submissions or button clicks.
If you need further assistance, contact us at support@oursprivacy.com.
How is this guide?

