Analytics · Installation

JavaScript · standard version

<script>
(function(w,d,c,u,n,a,s){w[n+'_queue']=w[n+'_queue']||[];w[n]=function(){w[n+'_queue'].push
(Array.prototype.slice.call(arguments))};var f=d.getElementsByTagName(c)[0];var j=d.createElement(c);
j.async=true;j.type='module';j.src=u+(u.indexOf('?')>=0?'&':'?')+'aid='+a+(n&&n!=='osb'?'&name='+n:'')+
(s?'&sid='+s:'');f.parentNode.insertBefore(j,f)})(window,document,'script',
'https://${TRACKER_URL}/js/osb.min.mjs','osb','${ACCOUNT_ID}','${DEFAULT_SITE_ID}');
// Tracking events go here...
</script>

Make sure to replace the following text with the values that apply to your website. Contact us for guidance.

  • ${TRACKER_URL} replace with your tracker URL
  • ${ACCOUNT_ID} replace with your account ID
  • ${DEFAULT_SITE_ID} replace with a default site ID

JavaScript · CMP version

This is a special version of the analytics JS library that includes Onesecondbefore's Consent Management Platform (CMP). It has exactly the same possibilities as the regular library, only osb('consent', ...); now uses Onesecondbefore's IAB TCF v2.0 compatible Consent Management Platform. See the reference#consent-cmp for more details.

<script>
(function(w,d,c,u,n,a,s){w[n+'_queue']=w[n + '_queue'] || [];w[n]=function(){w[n+'_queue'].push
(Array.prototype.slice.call(arguments))};var f=d.getElementsByTagName(c)[0];var j=d.createElement(c);
j.async=true;j.type='module';j.src=u+(u.indexOf('?')>=0?'&':'?')+'aid='+a+(n&&n!=='osb'?'&name='+n:'')+
(s?'&sid='+s:'');f.parentNode.insertBefore(j,f)})(window,document,'script',
'https://${TRACKER_URL}/js/osb.min.mjs','osb','${ACCOUNT_ID}','${DEFAULT_SITE_ID}');
osb('consent', { consent options... }
// Tracking events go here...
</script>

Make sure to replace the following text with the values that apply to your website. Contact us for guidance.

  • ${TRACKER_URL} replace with your tracker URL
  • ${ACCOUNT_ID} replace with your account ID
  • ${DEFAULT_SITE_ID} replace with a default site ID

Android

Add the following repository and dependency to your app's build.gradle file:

repositories {
    ...
    maven {
        url "https://www.onesecondbefore.com/repository"
    }
}

dependencies {
    ...
    implementation 'com.onesecondbefore.tracker:tracker-android:1.0.1'
}

After installation, consult our mobile reference documentation. Need help? Contact support.

iOS

Prerequisites

  • Deployment Target iOS 11 or later.
  • Xcode 10.1 and iOS SDK 11 or later.
  • iPhone, iPad or iPod touch.

Integration via CocoaPods

The OSB SDK can be integrated via CocoaPods.

target '[Your Target Name]' do
pod 'onesecondbefore-tracker'
end

Import the SDK into your code

Use import OSB. We don't require any additional bridging header to use this pod file.

After installation, consult our mobile reference documentation. Need help? Contact support.

React Native

Contact support.