Onesecondbefore has created support for Bookmarklets. These work in all browsers and this makes testing and debugging of your tagging implementation easier.
In order to debug and test the Onesecondbefore tracking, you need to know you user_id in order to filter the hits out of the database.
An easy way to retrieve it, is to run the following code in the JavaScript Console of your browser. It will log the user_id in the JavaScript Console
Drag & drop the following link to your bookmarks bar: Show OSB UID
Or copy & paste the following code in the URL field of a bookmark.
javascript:if (typeof(osb)==='undefined'){alert('Onesecondbefore is not installed on this website!')} else {osb('uid', function(uid){prompt('Your Onesecondbefore User ID is:', uid)});}
When clicking on this Bookmarklet, you will switch the Preview mode On or Off.
Drag & drop the following link to your bookmarks bar: Preview On/Off
Or copy & paste the following code in the URL field of a bookmark.
javascript:if (localStorage.getItem('_osb_preview')==='1'){localStorage.removeItem('_osb_preview');alert('Switched Off Preview Mode');}else{localStorage.setItem('_osb_preview', '1');alert('Switched On Preview Mode')}
In some cases, you want to force Onesecondbefore to show the CMP again. If you click on this bookmarklet, it will be shown.
Drag & drop the following link to your bookmarks bar: Show CMP
Or copy & paste the following code in the URL field of a bookmark.
javascript:osb('consent', {'show': true});
If you would like to see the TC String, you can use this Bookmarklet to show it.
Drag & drop the following link to your bookmarks bar: Show IAB TC String
Or copy & paste the following code in the URL field of a bookmark.
javascript:if (typeof(__tcfapi)!=='undefined') {__tcfapi('getTCData', 2, (tcData, success) => {if(success) {prompt('The TC String is:',tcData.tcString);} else {console.log('no succes');}},[1,2,3]);} else { alert('No TCF on this website!')}