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.getTags and Glimr.getCachedURLTags return different type of tags. Glimr.getTags will always return the sum of both calls, whereas Glimr.getCachedURLTags will tags only relating to the URL (not user behavior).

The flow is:

  1. User opens page, Glimr.getTags is called
  2. User navigates to another page
  3. Calling Glimr.getCachedURLTags will 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"));
    });
}