The NoibuJS SDK allows you to interact with information Noibu Captures by creating a custom attribute for your session.
The NoibuJS SDK can be accessed from the global window object. The NOIBUJS attribute is set on the window object as soon as our script loads. Before using the SDK, you should check if it is defined. A way you can do that is as follows:
This function checks if the window object has NOIBUJS attribute every 3 seconds and once found, stops the interval calls the function within the SDK. The function is addCustomAttribute.
The addCustomAttribute function will add a custom attribute to the session you are working on, helping you isolate it on the Noibu platform. The attribute can be used to search noibu sessions in session search, click here for more information on session search. You can use both name value or attribute value to search session search. Searching by the name will return all the sessions where that id with that name was used. Searching by value will only return the sessions where the value matches the value searched. If you want to match the name and value, then use both filters in session search.
addCustomAttribute can be used in a variety of ways. Here are a few examples of the use for this function:
Create a custom attribute for Customer ID:
Create a custom attribute for a marketing campaign:
Create a custom attribute for logged in status:
Create a custom attribute for an A/B test:
These are just a few use cases and the capabilities of the use is within your hand.
- name: The name of the attribute
- value: The value of the attribute
- name: String, with maximum 50 characters
- value: String, with maximum 50 characters
Only 10 attributes can be added per page. Every time the user causes the page to reload that counts as a new page. So for example if a user visits 10 pages, then you can have 100 attributes in that session, since each page can have up to 10 attributes.
Here are some examples of inputs that do not work with the addCustomAttribute function:
As you can see, once you set an id with a name, you can not set an id with that name again even with a different value. You cannot also use an object or number as a parameter, the function only takes strings.