Cached URL tags
Glimr crawls your web property and knows which URL indicates a set of tags, based on filters you setup in the dashboard. The Glimr SDK can download and cache this database in an efficiant manner, and you can use it to get tags without having to make a network request. To fetch the tags associated with the current browser URL you call Glimr.getCachedURLTags which does a fast synchronous lookup.
This is only for tags that can be predetermined for a host
Glimr.getTagsandGlimr.getCachedURLTagsreturn different type of tags.Glimr.getTagswill always return the sum of both calls, whereasGlimr.getCachedURLTagswill tags only relating to the URL (not user behavior).
The flow is:
- User opens page,
Glimr.getTagsis called - User navigates to another page
- Calling
Glimr.getCachedURLTagswill return tags that could be prematurely determined for the current URL
Fetches all tags associated with the current browser client.
var cachedURLTags = Glimr.getCachedURLTags("YOUR_CLIENT_ID");
if (cachedURLTags) {
console.log("cachedURLTags", cachedURLTags);
} else {
Glimr.getTags("YOUR_CLIENT_ID", function(tags) {
console.log("tags", tags);
console.log("URL cache is now", Glimr.getCachedURLTags("YOUR_CLIENT_ID"));
});
}Updated 9 months ago
