UGC Techdocs
  • Introduction
  • Guides
    • Analytics
      • Tracking UGC on Adobe Analytics
      • Tracking Widget interactions with Google Analytics
    • Direct Uploader
      • How to add Custom Data to Direct Uploader
      • How to capture Custom Data on Direct Uploader
      • How to automatically tag data on Direct Uploader
      • How to Customize error messages on Direct Uploader
      • How to Track Direct Uploader form submissions with Google Analytics (Universal & GA 4)
    • Data Templates
      • Creating a Data Template
    • Rights via Registration
      • Capture Custom Data on Rights by Registration Form
      • Styling Rights via Registration Form
    • REST API
      • Caching REST API results for optimization
      • Posting content into Nosto via Tile API
      • Posting images into Nosto via Tile API
    • Onsite Widgets (2.0)
      • Blank Canvas
        • How to Use the Blank Canvas to Create a Twitter Count Widget
        • Creating an Auto-Scrolling Carousel using Blank Canvas
        • Creating Gallery Widget by Using the Blank Canvas Widget
        • Creating a simple Hover effect using Blank Canvas
        • Creating a Word Cloud using Blank Canvas
        • Creating Your Widget by Using the Blank Canvas
      • Bind your own Events
      • Creating a Grid Widget from Waterfall
      • Create a Q&A Widget using Data Templates
      • Displaying a Widget in a Mobile App
      • Dynamically Specify Products to Display in Widget
      • Dynamically specify what Tile to display in a Widget
      • How to add a title / subtitle to a widget
      • How to localize the load more button on widgets
      • How to overlay existing Google Map with the UGC Map Widget
      • Styling cross-sellers on Grid and Carousel Widgets
      • How to Load External JS and CSS into Widgets
      • Profiling Widget Performance
      • Re-targeting with Widgets and Facebook Pixel
      • Render Widget filters dynamically
      • Styling Carousel Widget
      • Styling Grid Widget
      • Styling Masonry Widget
      • Styling Waterfall Widget
      • Styling Widget Expanded Tile
      • Styling Widget Shopspots
      • Using Web Fonts in Widgets
    • Digital Screens
      • Customizing Carousel Event Screen
      • Customizing Mosaic Event Screen
      • Customizing Scrollwall Event Screen
      • Customizing the Mosaic Event Screen to Have 9 Even Tiles
    • Email
      • Adding Location to an Email Tile
      • Styling the Email Widget
    • Integrations
      • DoubleClick
        • UGC Ads with Nosto and Google DoubleClick
      • Zapier
        • Consuming UGC Webhooks via Zapier
      • Mailchimp
        • Bring Social Content into a Mailchimp Campaign
    • Webhooks
      • Trigger notifications when content is in the moderation queue
  • Widgets
  • API Docs
    • JavaScript API
      • Widgets
        • Introduction
        • API Reference for Content Widgets
        • API Reference for Blank Canvas
        • API Reference for Map Widget
      • Digital Screens
        • Introduction
        • API Reference
    • Content API
      • Reference
    • REST API
      • Reference
        • Filters API
        • Moderation Views API
        • Tags API
        • Terms API
        • Tiles API
        • Users API
        • Widgets API
        • Automation Rules API
        • REST API Reference Widgets style and config
      • Best Practices
    • Webhooks
  • Enterprise Tools
    • Automation Rules
      • Triggers
      • Actions
      • Samples
    • Data Templates
    • User Access Control (UAC)
    • Single Sign On (SSO)
    • Enterprise Admin User Interface (EAUI)
    • Zapier
  • Commerce Tools
    • Product Feeds
    • Widget Implementation
    • Reporting
    • Integrations
      • Google Tag Manager
      • Magento
      • SalesForce Commerce Cloud
      • Shopify
      • Shopify Add To Cart
        • Global Variant Mapping for Add to Cart
        • Customise Add to Cart Widget Experience
  • Analytics
    • Google Analytics 4
      • Getting Started
      • Widgets Events
      • E-commerce Events
      • Email Events
  • Terms of Use
Powered by GitBook
On this page
  • Overview
  • Embed Code
  • Dynamic Variables
  • Localize Widgets

Was this helpful?

  1. Commerce Tools

Widget Implementation

PreviousProduct FeedsNextReporting

Last updated 9 months ago

Was this helpful?

Overview

All Nosto's UGC Widgets leverage a similar Embed Code structure, with variations in designs and content handled through a series of parameters.

This structure not only makes it easier for our clients to integrate with various Content Management Systems (CMS) platforms but also means the same Widget can be used for multiple executions as well.

Detailed below are the step-by-step ways in which the dynamic display features of Nosto's UGC Widget can be used for Commerce implementations.

Embed Code

All Nosto's UGC Widgets leverage a common embed code structure which can be broken into two components. The first component (included below) is the DIV container which defines where the UGC Widget should be rendered on a webpage, as well as includes the various parameters that define what Widget and what Content is loaded.

<div class="stackla-widget" data-ct="" data-hash="{{widget-hash}}" data-id="{{widget-id}}" data-title="{{widget-title}}" data-ttl="60" style="width: 100%; overflow: hidden;"></div>

The second component is the Widget Javascript. This is the part of the Embed code which is consistent for every Widget. For details on how to store this Javascript file in Google Tag Manager, .

<script type="text/javascript">
(function (d, id) {
    var t, el = d.scripts[d.scripts.length - 1].previousElementSibling;
    if (el) el.dataset.initTimestamp = (new Date()).getTime();
    if (d.getElementById(id)) return;
    t = d.createElement('script');
    t.src = '//assetscdn.stackla.com/media/js/widget/fluid-embed.js';
    t.id = id;
    (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(t);
}(document, 'stackla-widget-js'));
</script>

For Commerce Implementations, we will be looking at what variables can be changed and the impact this has on the Widget display.

Dynamic Variables

All UGC Widgets leverage a common embed code structure which can be broken into two components. The first component (included below) is the DIV container which defines where the UGC Widget should be rendered on a webpage, as well as includes the various parameters that define what Widget and what Content is loaded.

  • data-id: Widget ID

  • data-hash Widget Hash

  • data-filter: Defines the filter/segment of content to show

  • data-tags: Defines the tag(s) which need to be present for content to show

  • data-tags-grouped-as: Specifies the grouping logic for the Tags

  • data-tag-group: Defines Products for a specific locale

  • data-available-products-only: Defines whether to show Product information for unavailable products

  • data-ct: Apply a consistent click-through URL to all Tiles

  • data-tile-id : Defines a specific Tile(s) to display

  • data-search : Apply keyword search for message and user

The variables data-id and data-hash allow customers to define what Widget to display. Note: Only one of the variables, data-id and data-hash, needs to be defined.

The variable data-filter allows for customers to define what content to display within a Widget based on a specific Filter ID. The IDs for all Filters can be found within the Nosto Admin Portal under Curate > Filters.

The variable data-tags-grouped-as allows for customers to define the grouping logic for the Tags they are dynamically refining. The supported values for this variable are AND and OR with the Widget set to OR by default.

The variable data-available-products-only allows clients to decide whether Product Tag information should be shown for any Products that are currently out of stock. The supported values for this variable are true and false with the Widget set to false by default.

Localize Widgets

By default, Nostio's UGC will show the locale information for the first Product Feed imported.

The variable data-tags allow customers to define what content to display within a Widget based on the tag(s) that has been assigned to the content. Through this variable brands can define whether they wish to show content for a specific Product or a range of Products by simply adding their UGC Tag ID or External Product ID/SKU. The following guide provides further information about how to .

The variable data-tile-id allows for clients to define specific Tile(s) of content to display within a Widget. The following guide outlines how to .

The variable data-tag-group allows for clients to define what Locale information should be displayed for a particular Widget. The possible values for this variable are defined as part of the and only apply to customers who are importing more than one Product Feed.

Customers can also use the Custom Code Editor to further localize the widget using JavaScript. An example of how to localize the copy of the Load More button is documented .

dynamically specify what Products to display
dynamically specify what Tile to display in a Widget
here
Return to Top
Return to Top
Shopify Add To Cart
Overview
Embed Code
Dynamic Variables
Product Feed setup
click here