How to send custom metrics

Last updated: January 22, 2026

Also available in:Français

1. Available fields for organic content#

  • newLead: send a new lead creation.
  • quantity: send the number of purchased or subscribed product units.
  • amount: send the revenue generated by the transaction.
  • commentCount: send the total number of comments when a new comment is added.
  • externalClick: send an external affiliate link click.
  • videoViews: send the total video views for the article video.
  • paywallView: send when the paywall is viewed.
  • paywallClick: send when the paywall is clicked.
  • paywallUnlocked: send when the paywall is unlocked.
  • paywallSubscribeClick: send when the subscribe button is clicked in the paywall.
  • paywallLoginClick: send when the login button is clicked in the paywall.
  • subscriptionComplete: send when a subscription has been completed.
  • canonicalUrl: send metrics from a page other than the article page.

2. Implementation examples#

javascript
1if (window._nli && window._nli.sendMetrics) {
2 window._nli.sendMetrics({
3 newLead: 1
4 });
5}
javascript
1if (window._nli && window._nli.sendMetrics) {
2 window._nli.sendMetrics({
3 videoViews: 12410
4 });
5}
javascript
1if (window._nli && window._nli.sendMetrics) {
2 window._nli.sendMetrics({
3 paywallView: 1,
4 paywallSubscribeClick: 1,
5 amount: 99.99,
6 quantity: 12,
7 currency: "EUR",
8 canonicalUrl: "https://www.example.com/my/article/content"
9 });
10}

Was this article helpful?

Our support team is here to help you.