Configuration Guide
Learn how to configure the OIR SDK for your website.
The following options are required:
| Option | Type | Description |
|---|---|---|
oirid |
string | Your unique publisher ID (provided by your account manager) |
oirtyp |
string | Pixel type identifier |
Set configuration via script attributes during installation:
<script type="text/javascript">
!(function (s) {
var o = s.createElement('script'),
u = s.getElementsByTagName('script')[0];
o.src = 'https://cdn.aggle.net/oir/oir.min.js';
o.async = !0;
o.setAttribute('oirtyp', 'YOUR_INTEGRATION_TYPE');
o.setAttribute('oirid', 'YOUR_INTEGRATION_ID');
u.parentNode.insertBefore(o, u);
})(document);
</script>
Configure the SDK after it loads using the cfg() method:
window._oirtrk = window._oirtrk || [];
window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
});
| Option | Type | Req | Default | Description |
|---|---|---|---|---|
oirid |
string | ✅ | - | Your publisher ID |
oirtyp |
string | ✅ | - | Pixel type identifier |
brandedLinkDomain |
string | ❌ | - | First-party tracking domain |
autoPageView |
boolean | ❌ | true | Automatically track page views |
controlledMode |
boolean | ❌ | false | Read-only mode, manual tracking only |
window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
brandedLinkDomain: 'track.yourdomain.com',
autoPageView: true,
controlledMode: false,
});
When controlledMode: true, the SDK becomes read-only for identity and storage:
- No userId generation or cookie/localStorage writes
- No auto-tracking (CSC/ACK/ECHO/OST/auto pageview)
- Tracking occurs only through manual calls (
event,identify,set-identifier)
window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
controlledMode: true,
});
Use set-identifier to provide user identity explicitly. If no userId is available, events are sent without X-Reference-Uid.
The autoPageView option controls whether the SDK automatically tracks page view events when pages load.
By default, autoPageView is set to true, meaning the SDK automatically fires a page_view event on every page load without any additional implementation.
Set autoPageView to false if you want to:
- Implement custom page view tracking logic
- Track page views only on specific pages
- Add custom data to page view events
window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
autoPageView: false, // Disable automatic page view tracking
});
When disabled, you must manually track page views using the Custom Events syntax.
Note: For more details on page view tracking, see the Page View Guide.
The brandedLinkDomain option enables first-party tracking by using your own custom domain instead of the default tracking domain. This extends cookie lifetime and improves tracking accuracy across browsers with strict privacy restrictions.
Modern browsers apply restrictions to third-party cookies:
| Browser | Third-Party Cookies | First-Party Cookie Limit |
|---|---|---|
| Safari | ❌ Blocked | 7-day cap (if IP mismatch) |
| Firefox | ❌ Blocked (Strict) | 7-day cap (known trackers) |
| Chrome | ⚠️ User Choice | 400-day maximum |
| Edge | ⚠️ User Choice | 400-day maximum |
First-party tracking bypasses these restrictions by serving tracking requests from your own domain.
- Extended cookie lifetime: Up to 180+ days vs 7 days for third-party
- Bypass ad blockers: Tracking requests appear as first-party traffic
- Improved accuracy: Higher data collection rates
- Privacy compliance: First-party tracking is more privacy-friendly
- Better attribution: More accurate user journey tracking
You can configure first-party tracking using either a CNAME record or an A record.
Point your tracking subdomain to the tracking service:
track.yourdomain.com. CNAME api.aggle.net.
Advantages:
- Simple setup
- Automatic IP updates if service changes
- Easy migration
Limitations:
- Cannot be used at apex/root domain
- Some DNS providers have restrictions
Point your tracking subdomain directly to the tracking IP:
track.yourdomain.com. A [PROVIDED_IP_ADDRESS]
Advantages:
- Works at apex/root domain
- Better Safari ITP compatibility (IP matching)
- More control over DNS
Limitations:
- Requires manual update if IP changes
- IP address provided by account manager
Note: Contact your account manager to get the appropriate IP address for A record setup.
After DNS is configured, set the brandedLinkDomain option:
window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
brandedLinkDomain: 'track.yourdomain.com',
});
After setup, verify your configuration:
- Open browser DevTools → Network tab
- Trigger a tracking event
- Confirm requests go to
track.yourdomain.com(your domain) - Check Application → Cookies for first-party cookies
| Scenario | Recommended |
|---|---|
| Standard setup | CNAME record |
| Safari ITP optimization | A record |
| Root domain tracking | A record |
| Simple maintenance | CNAME record |
Note: Contact your account manager for setup instructions and to verify your domain configuration.
- Quick Start Guide - Track your first event
- Installation Guide - Install the SDK
- Custom Events Guide - Track custom business events