It’s Time for Privacy Pros to Make a Strategic Shift
The importance of effective data privacy can no longer be ignored.
Read NowGet an overview of the simple, all-in-one data privacy platform
Manage consent for data privacy laws in 50+ countries
Streamline and automate the DSAR workflow
Efficiently manage assessment workflows using custom or pre-built templates
Streamline consent, utilize non-cookie data, and enhance customer trust
Automate and visualize data store discovery and classification
Ensure your customers’ data is in good hands
Key Features & Integrations
Discover how Osano supports CPRA compliance
Learn about the CCPA and how Osano can help
Achieve compliance with one of the world’s most comprehensive data privacy laws
Key resources on all things data privacy
Expert insights on all things privacy
Key resources to further your data privacy education
Meet some of the 5,000+ leaders using Osano to transform their privacy programs
A guide to data privacy in the U.S.
What's the latest from Osano?
Data privacy is complex but you're not alone
Join our weekly newsletter with over 35,000 subscribers
Global experts share insights and compelling personal stories about the critical importance of data privacy
Osano CEO, Arlo Gilbert, covers the history of data privacy and how companies can start a privacy program
Upcoming webinars and in-person events designed for privacy professionals
The Osano story
Become an Osanian and help us build the future of privacy!
We’re eager to hear from you
Cookie Consent contains three modules named Popup, Law and Location.
Together, these modules: get the country code, apply the law specific to that country, and display the popup (if necessary)
In code form, a service looks like this:
{
url: <string> //The location of the service API
isScript: <boolean>, //Whether to use a script tag or a XMLHttpRequest
data: <object>, //Useful if the service requires post data
headers: <array>, //Useful for setting service specific header
callback: <function(done, response)>, //A handler for understanding the response
}
The callback provides a done callback. If you need to make additional requests, call done with the country code when you’re finished. Otherwise, just return the country code
Example:{
url: '//example-service/script.js',
isScript: true,
callback: function (done, response) {
// We just downloaded the 'script.js' which defined a third party object.
if (!window.MyService) {
done(new Error('The JavaScript file failed to download and define MyService'));
}
MyService.locateMe(function(response){
done({code: response.countryCode});
}, function(err){
done(new Error(err));
});
},
}
In order to find the location, Cookie Consent uses third-party location services. These third-party services usually provide an API that can be accessed over the internet.
To integrate a new service, you need to define the service location, the type of request (XMLHttpRequest vs <script>) and how the tool should interpret the response.
To do this, define a new service like so:
cookieconsent.initialise({
...popupOptions,
location: {
serviceDefinitions: {
mynewservice: function(options) {
return {
url: '//example-service.com/json',
callback: function(done, response) {
// This function must parse the 'response' and return the country code, or fail.
// If this function doesn't fail correctly, then the next service will not run.
// Therefore, it's generally best to add a <em>try {...} catch () {...}</em> block
try {
var json = JSON.parse(response);
if (json.countryCode) {
return {code: json.countryCode}
}
throw 'Could not find a country code in the response';
} catch (err) {
return new Error('Invalid response (' + err + ')');
}
},
};
},
},
services: [
'mynewservice'
]
}
});
Above, you can see that we first define our service, then we use it by adding it to the services array. We can add it simply by passing the name of it as a string.
Some service definitions may be more complicated though, and require configuration.
To do this, you can pass an object instead:services: [
{
name:'mynewservice',
mySpecialOption: 'some value',
KEY: 'uUCGtoyeiH5gsm3Wn2cp9D1Z1deHcpBG8ySA4hYBcQd20Z4C6AwGKqln7mtEfGN'
}
]
Then, when defining your service, the options are passed through like so:
mynewservice: function(options) {
// `options.mySpecialValue` and `options.KEY` now exist
return {
url: '//someurl.com?apiKey='+options.KEY
// ...serviceDefinition
};
}
As well as passing an object with options into the ‘services’ array, you can also pass a function that returns an object, just because.
Above, we integrated options.KEY with the url by simply appending the two string. If you’re lazy, there is an option called interpolateUrl which will automatically interpolate a string with the values of an object. Use it like so:
serviceDefinitions: {
mynewservice: function(options) {
return {
url: '//example-service.com/json?key={api_key}&someValue=1&callback={callback}',
isScript: true,
// use this flag to tell the tool to download
// the resource as a script tag (using JSONP)
callback: function(done, response) {
// handle response
},
};
},
},
services: [
{
name: 'mynewservice',
interpolateUrl: {
api_key: 'uUCGtoyeiH5gsm3Wn2cp9D1Z1deHcpBG8ySA4hYBcQd20Z4C6AwGKqln7mtEfGN'
}
}
]
The {callback} string can be used in the URL to automatically write the JSONP callback. It is appended with Date.now() to prevent global namespace collisions.
Now, with Osano Privacy Legal Templates you can get started faster by leveraging templates generated by our global team of privacy experts.
Capture data subject rights requests with the convenience of email and the efficiency of a dedicated intake form.
We've reworked and redesigned Osano Subject Rights Management and Data Discovery, unifying them into a single, seamless experience and creating automation to save you time.
Privacy regulators at the CNIL in France recently declared that Google Analytics violates GDPR. Osano’s new block list feature can disable Google Analytics in France to keep you compliant while allowing you to use Google Analytics in regions where it is still legal.
Customize DSAR forms with conditional fields, serve consent banners in additional languages, use 28 new integrations for Data Discovery, and more! Check out our latest product announcement blog for demos, links, and more information.
Osano product & engineering teams have been hard at work. View the full list of all product updates.