Skip to content
  • There are no suggestions because the search field is empty.

Configuration Guide

Learn how to configure the OIR SDK for your website.

Required Configuration

The following options are required:

Option Type Description
oirid string Your unique publisher ID (provided by your account manager)
oirtyp string Pixel type identifier

Script Attributes Configuration

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>
 

Programmatic Configuration

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',
});
 

Configuration Options

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

 

Example with All Options

window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
brandedLinkDomain: 'track.yourdomain.com',
autoPageView: true,
controlledMode: false,
});
 

Controlled Mode (Read-Only)

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 (eventidentifyset-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.

Automatic Page View Tracking (autoPageView)

The autoPageView option controls whether the SDK automatically tracks page view events when pages load.

Default Behavior

By default, autoPageView is set to true, meaning the SDK automatically fires a page_view event on every page load without any additional implementation.

Disabling Automatic Page Views

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.


First-Party Tracking (brandedLinkDomain)

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.

Why First-Party Tracking?

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.

Benefits

  • 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

DNS Setup Options

You can configure first-party tracking using either a CNAME record or an A record.

Option 1: CNAME 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

Option 2: A Record

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.

SDK Configuration

After DNS is configured, set the brandedLinkDomain option:

window._oirtrk.cfg({
oirid: 'YOUR_INTEGRATION_ID',
oirtyp: 'YOUR_INTEGRATION_TYPE',
brandedLinkDomain: 'track.yourdomain.com',
});
 

Verification

After setup, verify your configuration:

  1. Open browser DevTools → Network tab
  2. Trigger a tracking event
  3. Confirm requests go to track.yourdomain.com (your domain)
  4. Check Application → Cookies for first-party cookies

Which Option to Choose?

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.


Next Steps

  1. Quick Start Guide - Track your first event
  2. Installation Guide - Install the SDK
  3. Custom Events Guide - Track custom business events