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:

  1. Data Generation: Magento backend prepares structured data for Nosto

  2. Data Delivery: Methods to deliver this data to the frontend

  3. 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:

  1. Create an API endpoint in your Magento module:

  1. Implement the service:

  1. Register in di.xml:

  1. Define in webapi.xml:

Method 2: GraphQL

For PWA implementations, GraphQL is often preferred:

  1. Create schema.graphqls:

  1. 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

  1. Verify data structure: Ensure your API returns properly formatted data

  2. Check Nosto Debug Toolbar: Enable the Nosto Debug Toolbar to verify data is being sent

  3. Validate with Nosto Dashboard: Check if data appears in the Nosto dashboard

  4. Test recommendations: Ensure recommendations appear on your pages

Troubleshooting

Common issues and solutions:

Issue
Solution

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?