Integration

Let’s setup Genie Tracking!

Recommended

Setup usually take about 10 minutes

1

Add the Script :Copy and paste the following script tag into the <head> section of your HTML file:

<script src="https://genietracking.com/script/tracker.min.js"></script>

2

Add the Script: Initialize the event tracker in your JavaScript file

window.Tracker.init(brand_id, email, { 'meta_key': 'meta_value' });


// If you do not have an email, you can initialize the tracker without it:

window.Tracker.init(brand_id, "", { 'meta_key': 'meta_value' });

This script can be put into <script onload=...> to make sure this runs after script loaded

3

Track Events: Use the tracker to log events in your application:

window.Tracker.track('event_name', { property: 'value' });

4

Verify Tracking: Verify that your events are being tracked correctly by checking the event logs in your dashboard.

Messageflow
Update Profile

Use the tracker to update customer profile in your application:

window.Tracker.updateProfile({ key: 'value' });

Set Metadata for Profile

Use the tracker to set metadata for customer profiles in your application:

window.Tracker.setMetadata({key: 'value'});

All-in-One Script

You can use the following all-in-one script to include the tracker and initialize it:

var script = document.createElement('script');

<script>

(function() {

<script src="https://genietracking.com/script/tracker.min.js"></script>

script.onload = function() {

window.Tracker.init(brand_id, email, { 'meta_key': 'meta_value' });

window.Tracker.track('event_name', { property: 'value' });

window.Tracker.updateProfile({ key: 'value' });

window.Tracker.setMetadata({ key: 'value' });

};

document.head.appendChild(script);

})();

</script>