Introduction

AIDEM Stream is the cornerstone of AIDEM Data Strategy. Is is used to collect data to inform our buying capabilties and measure results.

Stream Initialization

To enable Stream on your website, you need to add a small piece of HTML code to the <head> section of your page. Your AIDEM Account Manager will provide the data-key.

<script src="https://stream.aidemsrv.com/lib/stream.js"
        data-key="your_uuid_here"
        data-init-only="false"
        defer></script>
<script>window.aidemstream = window.aidemstream || (function(){(window.aidemstreamQ = window.aidemstreamQ || []).push(arguments);})</script>

The snippet send the Page view event automatically. If you want to disable this, set data-init-only to "true".

If you are using a Tag Manager that limits custom parameters to script initialization (like GTM), you can use this code:

<script>
  (function() {
    var el = document.createElement('script');
    
    el.setAttribute('src', 'https://stream.aidemsrv.com/lib/stream.js');
    
    el.setAttribute('data-key', 'your_uuid_here');
    el.setAttribute('data-init-only', 'false');
    el.setAttribute("defer", "");
    
    document.body.appendChild(el);
  })();
</script>
<script>window.aidemstream = window.aidemstream || (function(){(window.aidemstreamQ = window.aidemstreamQ || []).push(arguments);})</script>

Sending Events

After Stream initialization, you can send events with:

<script>
  aidemstream('track', 'event_name')
</script>

You can replace 'event_name' with one of the allowed events.

If you want to send a payload with your event, you can use this syntax:

<script>
  aidemstream('track', 'Purchase', {
    price: 12,
    currency: 'USD'
  })
</script>

Retail media activations

If you want to activate your retail data, you can send the payload after agreeing with AIDEM on the data schema.

<script>
  aidemstream('track', 'PageView', {
    price: 12,
    currency: 'USD',
    brand: 'AIDEM',
    category: 'Apparel'
  })
</script>

Identifying Users

If the identity of the user is known, you can use this method to set their ID. We accepts two ID types: 'email' and 'phone', and in both cases the value will be hashed using SHA-256 before being send to our servers.

Identifier typeIdentifier headerDescription and formattingExample
Email'email'US and international formats are accepted.'[email protected]'
Phone'phone'Phone numbers must include a country code'+441234567890' or '441234567890'
<script>
  // You can use 'id' with an email:
  aidemstream('id', { email: '[email protected]' })
  // with a phone number:
  aidemstream('id', { phone: '+441234567890' })
  // or both:
  aidemstream('id', {
    email: '[email protected]',
    phone: '+441234567890'
  })
</script>

Additional identifiers

You can add additional identifier to increase match rate.

Identifier typeIdentifier headerDescription and formattingExample
Date of birth'dob'We accept only ISO 8601 format.'1992-05-25'
Gender'gen'We accept gender in the form of an initial, such as 'F' for female and 'M' for male.'F'
<script>
  // You can use 'id' with an email:
  aidemstream('id', {
    email: '[email protected]',
    dob: '1992-05-25',
    gen: 'F'
  })
  // with a phone number:
  aidemstream('id', {
    phone: '+441234567890',
    gen: 'F'
  })
  // or both:
  aidemstream('id', {
    email: '[email protected]',
    phone: '+441234567890',
    dob: '1992-05-25',
    gen: 'F'
  })
</script>

De-identifying Users

If you want to delete the identity of the user from our systems, you can use this method to delete their ID. If you have previously identified a user using both 'email' and 'phone', a deletion request containign only 'email' or 'phone' will delete both. Deletion requests will be processed immediatly.

Note: the deletion API is also available offline for

  • Bulk deletion request
  • Global deletion request: removing all user data ever sent by an data-key
  • Scoped deletion request: removing all user data ever sent by an data-key withing the specified time window or country.
<script>
  // You can use 'delete-id' with an email:
  aidemstream('delete-id', { email: '[email protected]' })
  // with a phone number:
  aidemstream('delete-id', { phone: '+441234567890' })
  // or both:
  aidemstream('delete-id', {
    email: '[email protected]',
    phone: '+441234567890'
  })
</script>

Conversion API

To use the Conversion API, add the event_id parameter to the payload, which must be a unique identifier of the transaction. If you are already using Meta, to avoid duplication of events, the event_id passed must be the eventID of the Meta pixel.

If you want to send a payload with your event_id, you can use this syntax:

<script>
  aidemstream('track', 'event_name', {
    price: 12,
    currency: 'USD',
    sku: 'abcde',
    event_id: 'EVENT_ID'
  })
</script>

Content Security Policy Directive

The HTTP Content-Security-Policy response header allows website administrators to control resources the user agent is allowed to load for a given page.

If your website uses CSPs, you need to add the following directives:

connect-src https://*.aidemsrv.com https://cnv.event.prod.bidr.io https://segment.prod.bidr.io https://match.prod.bidr.io;
frame-src https://*.aidemsrv.com https://cnv.event.prod.bidr.io https://segment.prod.bidr.io https://match.prod.bidr.io;
img-src https://*.aidemsrv.com https://cnv.event.prod.bidr.io https://segment.prod.bidr.io https://match.prod.bidr.io;
script-src https://*.aidemsrv.com https://cnv.event.prod.bidr.io https://segment.prod.bidr.io https://match.prod.bidr.io;
script-src-elem https://*.aidemsrv.com https://cnv.event.prod.bidr.io https://segment.prod.bidr.io https://match.prod.bidr.io;

Debug

Adding stream_debug=true as query parameter in the URL will log in the browser console data on event firing.

Cookies

Unless you request Audience Building or Post-view Event measurement, Stream will not set cookies.

Configuration Parameters

The configuration parameters should be passed as data- attributes. The full list of attributes can be found at Parameters Reference page.