Introduction
AIDEM Stream collects data for the AI
Quick Start
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, 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>
Configuration Parameters
The configuration parameters should be passed as data-
attributes. The full list of attributes can be found at Parameters Reference page.
Sending Events
You can send data 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', 'event_name', {price: 12, currency: 'USD'})
</script>
Persistent Properties
Persistent properties are properties that are set once and sent with every track event. You can set one with:
<script>
aidemstream('set', { source : 'Y' })
</script>
You can use unset to remove a property.
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', {event_id: 'EVENT_ID'})
</script>
Debug
Adding stream_debug=true
as query parameter in the URL will log in the browser console data on event firing.
Cookies
Stream will not set cookies.