Tagging Providers
This documentation explains how to implement Nosto tagging on headless frontends, PWA implementations, or custom themes that are neither Luma nor Hyva.
Table of Contents
Introduction
Nosto's tagging providers are a flexible way to send data to Nosto without requiring the traditional DOM-based tagging approach. This method is particularly useful for headless implementations, PWAs, or any frontend that doesn't follow Magento's traditional rendering approach.
Architecture Overview
The tagging provider system consists of three main components:
Data Generation: Magento backend prepares structured data for Nosto
Data Delivery: Methods to deliver this data to the frontend
Provider Registration: JavaScript that registers the data with Nosto
Data Structure
For more details, refer to the Nosto API documentation: https://nosto.github.io/nosto-js/interfaces/client.TaggingData.html
The tagging provider data follows this basic structure:
Integration Methods
Method 1: REST API
You can create a custom endpoint to retrieve the tagging data:
Create an API endpoint in your Magento module:
Implement the service:
Register in di.xml:
Define in webapi.xml:
Method 2: GraphQL
For PWA implementations, GraphQL is often preferred:
Create schema.graphqls:
Create the resolver:
Method 3: Direct JavaScript Implementation
If you're building a non-Magento frontend but using Magento's backend, you can include the Nosto tagging-providers.js script directly:
Implementing Tagging Providers
In your frontend application, after retrieving the data, you need to register the tagging providers:
Testing Your Implementation
Verify data structure: Ensure your API returns properly formatted data
Check Nosto Debug Toolbar: Enable the Nosto Debug Toolbar to verify data is being sent
Validate with Nosto Dashboard: Check if data appears in the Nosto dashboard
Test recommendations: Ensure recommendations appear on your pages
Troubleshooting
Common issues and solutions:
Nosto script not loading
Make sure the Nosto script is included before tagging providers
Data not appearing
Check browser console for errors, verify data structure
Recommendations not personalizing
Ensure customer data is correctly formatted
Multiple currencies not working
Check variation ID is properly passed
For more detailed assistance, consult the Nosto Support team or refer to the official Nosto documentation.
Last updated
Was this helpful?