When you embed the Claimr widget into your website or application, you use widget attributes within the integration script to customize its behavior and appearance. These attributes control what users see, allowing you to show or hide specific parts of the widget based on your business needs, user type, or even location-specific requirements (like country-based restrictions).
Essentially, widget attributes allow you to tailor the user experience, deciding what content appears and for whom.
How to add attributes
Add attributes directly into the Claimr script you’ve copied from the Publish section.
- Navigate to and click the Publish button in your campaign (upper right corner).
- In the opened window, click Get integration code. This will open the window with an embed code.
- Copy and paste the provided widget script into your website or application’s code.
- To customize the widget’s behavior, manually add the desired
data- attributes (detailed below) directly inside your <script> tag.
Example:
In this example:
data-organization and data-campaign: Select which organization and campaign the widget loads.
data-container: The ID of the element the widget renders into.
data-language: Opens the widget in French.
Keep id="claimr-script" exactly as it is. The script reads its attributes from the element with that ID, so a script tag with any other ID does not load the widget.
List of data attributes
This section lists all supported data-* attributes for the Claimr widget. Add them to the script tag (or to the <body> tag where specified) to control the widget’s behavior, appearance, or user experience.
Attributes marked with an asterisk * are required or applied by default.
Default attributes
Feature control
Advanced integration
Contextual display settings
Pre-quest badge
The SDK includes a built-in badge, award toasts, and claim button for pre-quests: rewards visitors bank on your site before they sign in. These attributes configure it. You can change the same settings at runtime with the configure_pre_quest() SDK method.
Tag-based customization
Personalize the user experience by dynamically showing or hiding Quests and Groups using tags. First, assign tags to your Quests/Groups in the Claimr admin panel. Then, use these data- attributes in your widget script to control their visibility:
data-hide-tags: This attribute hides Quests or Groups tagged with any of the comma-separated tags provided. For example, if a Quest Group in your admin panel is tagged new, adding data-hide-tags="new" to your script will hide that specific group:
data-show-tags: Conversely, this attribute is used to show Quests or Groups tagged with any of the listed comma-separated tags. This is useful if certain content is hidden by default or by other conditions and you want to make it visible for specific users (e.g., data-show-tags="beta_testers").
Using these attributes activates Claimr’s tag system. The widget receives the “show” or “hide” tags from your script, compares them against the tags on your content elements, and adjusts visibility accordingly. This enables targeted experiences like geo-restrictions or A/B testing.