Installation
The recommended way to install is via NPM and using a NPM-compatible bundler solution, like browserify. Then you can do:
npm install --save glimr-sdk
You can also embed the JS file directly using our CDN. A link to the latest minified version can be found here:
https://github.com/KatalysatorAB/GlimrSDK-JS
The SDK exposes a global instance named Glimr
. If you are using browserify
or any similar bundling solutions, what you need to do is simply:
var Glimr = require("glimr-sdk");
Tags
- Glimr.getTags
Retrieve a list of tags associated with the current browser - Glimr.setCacheTimeInSeconds
Set how long tags are cached - Glimr.getCacheTimeInSeconds
Get how long tags are cached - Glimr.getCachedURLTags
Get cached URL based tags - Glimr.getCachedBehaviorTags
Get cached behavior tags - Glimr.getCachedBehaviorTagsAndUpdateInBackground
Handles the regular use case where tags need to be retrieved syncronously and cached between page loads
Google Tag Manager
- Glimr. getTagsAndPushToDataLayer - Get tags and push them to Google Tag Manager automatically
Parsing/Stringifying/Serializing/De-serializing
- Glimr.objectToQuery - Create query string from a javascript object
- Glimr.arrayToQuery - Create query string from an array
- Glimr.queryToObject - Deserialize/Parse a query string into an object
- Glimr.escapeStringForQuery - Escape a string to be used for query strings
- Glimr.unescapeStringForQuery - Unescape a string to be used for query strings
Questions?
Please reach out to us on [email protected]!
Updated almost 3 years ago