Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm new to shopify
I'm developing an app for Shopify. It consists of three parts: plugin, a front-end (non-embedded) app, and a backend. Any website/shop built with Shopify has the ability to install our app and integrate our plugin into a section of the product page. The plugin basically embeds videos on product page
The problem is that I want to perform certain analytics on videos shown via plugins.
I can easily get total views on a video but ...
I want to get unique views per user session. For example, how many distinct user sessions are present and how many views a video receives in each session
Is there a method to distinguish a distinct user session in Shopify so that I may transfer that {sessionId} and the number of views.
- Any shopify API from which I can fetch a unique {sessionID} for every new user session?
- Something already available in localStorage/cookies/sessionStorage etc?
Solved! Go to the solution
This is an accepted solution.
Hi @ajs540,
- Did you try this? The result is shown below.
ShopifyAnalytics.lib.user().traits().uniqToken
- The value is stored in cookies
- I cleared site data, and the value is refreshed.
I hope this information is helpful to you.
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
This is an accepted solution.
Hi @ajs540,
- Did you try this? The result is shown below.
ShopifyAnalytics.lib.user().traits().uniqToken
- The value is stored in cookies
- I cleared site data, and the value is refreshed.
I hope this information is helpful to you.
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025