Skip to content
Sign inStart free
Grumeria Wiki

Consent and purchase signals

The installation script widget-consent-v1.js starts product search without cookies or analytics. Search terms, clicks and purchase signals are stored only after your consent manager sets data-analytics-consent on the script to 1; on withdrawal it sets the attribute back to 0. The JTL plugin does this itself. In other shops, add Grumeria search analytics to the statistics category of your consent manager and place one of the following templates directly after the installation script.

← All guides

The installation script widget-consent-v1.js starts product search without cookies or analytics. Search terms, clicks and purchase signals are stored only after your consent manager sets data-analytics-consent on the script to 1; on withdrawal it sets the attribute back to 0. The JTL plugin does this itself. In other shops, add Grumeria search analytics to the statistics category of your consent manager and place one of the following templates directly after the installation script.

Cookiebot: The template reads Cookiebot.consent.statistics and reacts to the CookiebotOnConsentReady, CookiebotOnAccept and CookiebotOnDecline events, so search analytics follows the Cookiebot statistics category.

<!-- https://www.cookiebot.com/en/developer/ -->
<script>
(function () {
  function grumeria(allowed) {
    var widget = document.querySelector('script[src*="widget-consent-v1.js"]');
    if (widget) widget.setAttribute('data-analytics-consent', allowed ? '1' : '0');
  }
  function sync() {
    grumeria(!!(window.Cookiebot && Cookiebot.consent && Cookiebot.consent.statistics));
  }
  ['CookiebotOnConsentReady', 'CookiebotOnAccept', 'CookiebotOnDecline'].forEach(function (name) {
    window.addEventListener(name, sync);
  });
  sync();
})();
</script>

Usercentrics (Web CMP version 3): Create a custom service called “Grumeria search analytics” and enter its service ID in the template. The template evaluates the UC_CONSENT event, which fires on every page load and every consent change, and also reads the current state on start via __ucCmp.getConsentDetails(). This template does not apply to the older version 2.

<!-- https://usercentrics.com/docs/web/features/events/uc-consent/ (Web CMP v3) -->
<script>
(function () {
  var SERVICE_ID = 'YOUR_SERVICE_ID';
  function grumeria(allowed) {
    var widget = document.querySelector('script[src*="widget-consent-v1.js"]');
    if (widget) widget.setAttribute('data-analytics-consent', allowed ? '1' : '0');
  }
  function sync(details) {
    var service = details && details.services && details.services[SERVICE_ID];
    grumeria(!!(service && service.consent && service.consent.given));
  }
  window.addEventListener('UC_CONSENT', function (event) { sync(event.detail); });
  if (window.__ucCmp) window.__ucCmp.getConsentDetails().then(sync);
})();
</script>

Borlabs Cookie 3: Create a service with the ID grumeria-statistics in the statistics group, or change the ID in the template. The template calls BorlabsCookie.Consents.hasConsent when Borlabs starts (borlabs-cookie-after-init) and when visitors save their choice (borlabs-cookie-consent-saved).

<!-- https://borlabs.io/kb/javascript-api-v3/ -->
<script>
(function () {
  var SERVICE_ID = 'grumeria-statistics';
  function grumeria(allowed) {
    var widget = document.querySelector('script[src*="widget-consent-v1.js"]');
    if (widget) widget.setAttribute('data-analytics-consent', allowed ? '1' : '0');
  }
  function sync() {
    var consents = window.BorlabsCookie && window.BorlabsCookie.Consents;
    try { grumeria(!!(consents && consents.hasConsent(SERVICE_ID))); } catch (error) { grumeria(false); }
  }
  window.addEventListener('borlabs-cookie-after-init', sync);
  window.addEventListener('borlabs-cookie-consent-saved', sync);
  sync();
})();
</script>

Then check your shop: after acceptance the script carries data-analytics-consent="1", after refusal or withdrawal "0". Search works in both cases. Browsers sending Do Not Track or Global Privacy Control never send analytics.

Purchase signals without the JTL plugin: on the order confirmation page, call window.Grumeria.reportPurchase after the installation script. id is the product ID as returned in search results, value the gross order line value in major currency units (2 × €29.99 = 59.98), quantity the quantity and currency the ISO currency code. Fill in the lines on your server from the order, without order numbers or customer data. Signals are sent only with consent; if the visitor consents on this page, the signal is sent then. If values are missing, Grumeria estimates them from the current price in the search catalog.

<script>
window.addEventListener('load', function () {
  if (!window.Grumeria) return;
  window.Grumeria.reportPurchase({
    currency: 'EUR',
    items: [
      { id: 'PRODUCT_ID', value: 59.98, quantity: 2 }
    ]
  });
});
</script>

The pilot report then shows search-related revenue: order lines whose product the same visitor clicked in search earlier on the same day. Reported and estimated values are listed separately. The figures do not show causation and include only visitors who consented.

Text module for your shop’s privacy policy. Adapt it to your shop and have it legally reviewed: “Grumeria product search. Our product search is provided by Grumeria, a service of webpowers UG (haftungsbeschränkt), Hillenbrandstr. 9, 86156 Augsburg, Germany, acting as our processor (Art. 28 GDPR); application, database and search index run in Frankfurt am Main. Search terms and technical connection data are processed to display search results (Art. 6(1)(b) or (f) GDPR); the IP address is only used briefly for delivery and abuse protection and is not stored in the search statistics. Only with your consent (Art. 6(1)(a) GDPR and the national rules implementing Art. 5(3) of the ePrivacy Directive) are search terms, displayed and clicked products and, for an order, the purchased product IDs with quantity, gross value and currency stored as well, without order number, name or address. A pseudonymous identifier that is derived from the IP address and changes daily prevents double counting and matches search clicks to purchases made on the same day. The data is only evaluated in aggregate, for example the revenue generated through search, and is deleted after 100 days at the latest. You can withdraw your consent at any time in the cookie settings; search keeps working.” Name the provision that applies in your country, for example § 25(1) TDDDG in Germany or § 165(3) TKG 2021 in Austria.

Special product ranges: if purchases reveal information about health, sex life or religious or political beliefs, for example medicines, medical and care products or adult products, purchase signals can be special categories of personal data under Art. 9 GDPR (CJEU, judgment of 4 October 2024, C-21/23). A general statistics consent is usually not sufficient. In such shops, enable purchase tracking only with explicit consent for exactly this purpose (Art. 9(2)(a) GDPR) or leave it off. Product search works without purchase signals.

Vendor documentation

Account setup and the dashboard are available in English and German.

Sign in

Related guides