Features Solutions Technology Tokenomics Docs About
Docs / Tutorials / Product Tagging

Product Tagging Tutorial

A complete guide to tagging your first product with TAG IT Network.

Tutorial Overview

In this tutorial, you will learn how to tag a physical product with an NFC chip and register it on the blockchain. By the end, you will have a fully authenticated product ready for verification.

What You'll Build

Prerequisites

Estimated Time

This tutorial takes approximately 30-45 minutes to complete, depending on your familiarity with NFC technology.

Step 1: Prepare Your Product

Before attaching an NFC tag, you need to identify the optimal placement location and prepare the surface.

Tag Placement Considerations

Diagram: Tag Placement Zones

Consider placing tags in accessible but protected areas. For luxury goods, common locations include inside packaging, on product labels, or embedded within the product itself.

Choose a location that is:

Surface Preparation

  1. Clean the surface with isopropyl alcohol to remove dust, oil, and debris
  2. Allow the surface to dry completely (2-3 minutes)
  3. For porous materials, apply a thin primer coat if necessary
  4. Mark the exact placement location with a light pencil mark
Important

Never place NFC tags directly on or within 1cm of metal surfaces. Use ferrite shielding if metal placement is unavoidable.

Step 2: Select NFC Tag

Choosing the right NFC tag is crucial for security and durability. TAG IT Network supports various tag types, but we recommend using tags with cryptographic authentication.

Recommended Tags

Tag Type Security Level Best For
NTAG 424 DNA High (AES-128) Luxury goods, high-value items
NTAG 213/215/216 Medium Consumer products, general use
ICODE SLIX2 Medium Industrial applications

For detailed tag specifications and purchasing options, see our Chip Selection Guide.

Step 3: Encode the Tag

Before attaching the tag, you need to encode it with a unique identifier and configure its security settings.

Using the TAG IT Mobile App

  1. Download the TAG IT Encoder app from the App Store or Google Play
  2. Log in with your developer credentials
  3. Select "Encode New Tag" from the menu
  4. Hold your phone near the blank NFC tag
  5. The app will write a unique identifier and security keys to the tag

Using the SDK (Programmatic Encoding)

For automated encoding workflows, use the SDK with an NFC writer device:

import { TagIt } from '@tagit/sdk';
import { NFCWriter } from '@tagit/nfc-tools';

const tagit = new TagIt({
  apiKey: process.env.TAGIT_API_KEY,
  network: 'mainnet'
});

// Initialize NFC writer
const writer = new NFCWriter({
  device: 'ACR122U' // Supported NFC reader/writer
});

async function encodeTag(productInfo) {
  // Generate unique tag ID
  const tagId = await tagit.tags.generateId();

  // Prepare tag payload
  const payload = {
    tagId: tagId,
    productSku: productInfo.sku,
    manufacturerId: productInfo.manufacturerId,
    timestamp: Date.now()
  };

  // Generate security keys
  const keys = await tagit.tags.generateKeys(tagId);

  // Write to NFC tag
  await writer.write({
    ndef: [{
      type: 'url',
      value: `https://verify.tagit.network/${tagId}`
    }],
    securityKeys: keys,
    lockTag: true // Prevent overwriting
  });

  console.log('Tag encoded successfully:', tagId);
  return tagId;
}

// Example usage
const tagId = await encodeTag({
  sku: 'WATCH-LUX-001',
  manufacturerId: 'MFR-12345'
});
Tip

Always test the encoded tag with a smartphone before attaching it to the product. Once attached, re-encoding may not be possible.

Step 4: Register on Blockchain

After encoding the tag, register the product on the blockchain to create an immutable record of authenticity.

Registration API Call

import { TagIt } from '@tagit/sdk';

const tagit = new TagIt({
  apiKey: process.env.TAGIT_API_KEY,
  network: 'mainnet'
});

async function registerProduct(tagId, productData) {
  const registration = await tagit.products.register({
    tagId: tagId,
    metadata: {
      name: productData.name,
      brand: productData.brand,
      category: productData.category,
      serialNumber: productData.serialNumber,
      manufactureDate: productData.manufactureDate,
      origin: productData.origin,
      description: productData.description,
      images: productData.imageUrls
    },
    owner: productData.initialOwnerAddress,
    options: {
      mintNFT: true, // Create NFT certificate
      storeOnIPFS: true // Store metadata on IPFS
    }
  });

  console.log('Product registered!');
  console.log('Transaction hash:', registration.txHash);
  console.log('Token ID:', registration.tokenId);
  console.log('IPFS hash:', registration.ipfsHash);

  return registration;
}

// Example usage
const result = await registerProduct('NFC-TAG-001-ABC', {
  name: 'Luxury Watch Model X',
  brand: 'Premium Timepieces',
  category: 'Watches',
  serialNumber: 'SN-2024-001234',
  manufactureDate: '2024-01-15',
  origin: 'Switzerland',
  description: 'Limited edition automatic watch with sapphire crystal',
  imageUrls: ['https://example.com/product-image.jpg'],
  initialOwnerAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f5c9E8'
});

Registration Response

{
  "success": true,
  "tagId": "NFC-TAG-001-ABC",
  "tokenId": "12345",
  "txHash": "0xabc123def456...",
  "ipfsHash": "QmXyz789...",
  "contractAddress": "0x1234567890abcdef...",
  "blockNumber": 45678901,
  "timestamp": "2024-01-15T10:30:00Z",
  "verificationUrl": "https://verify.tagit.network/NFC-TAG-001-ABC"
}
Gas Fees

TAG IT Network uses Polygon for low-cost transactions. Registration typically costs less than $0.01 in gas fees.

Step 5: Attach the Tag

With the tag encoded and registered, it's time to physically attach it to your product.

Application Methods

Diagram: Attachment Methods

Visual guide showing adhesive application, heat sealing, sewing into labels, and embedded placement techniques.

Adhesive Application (Most Common)

  1. Peel the backing from the adhesive NFC tag
  2. Align the tag with your marked placement location
  3. Press firmly from the center outward to remove air bubbles
  4. Apply pressure for 30 seconds for optimal adhesion
  5. For added security, apply a tamper-evident overlay sticker

Heat-Sealed Tags

For textile and apparel applications:

  1. Position the heat-seal tag on the fabric
  2. Apply heat press at 150-170°C for 10-15 seconds
  3. Allow to cool before handling

Sewn-In Labels

For garments and accessories:

Embedded Tags

For products with internal cavities:

Step 6: Verify Installation

After attaching the tag, perform a verification test to ensure everything works correctly.

Verification Checklist

  1. Read Test: Use your smartphone to tap the tag. The verification page should load.
  2. Data Verification: Confirm all product information displays correctly.
  3. Range Test: Test reading from various angles and distances (should work within 2-4cm).
  4. Security Test: Verify the cryptographic signature validates successfully.

Verification Script

import { TagIt } from '@tagit/sdk';

const tagit = new TagIt({
  apiKey: process.env.TAGIT_API_KEY,
  network: 'mainnet'
});

async function verifyInstallation(tagId) {
  console.log('Starting verification tests...\n');

  // Test 1: Tag exists in database
  const tagExists = await tagit.tags.exists(tagId);
  console.log('1. Tag registered:', tagExists ? 'PASS' : 'FAIL');

  // Test 2: Product data retrieval
  const product = await tagit.products.get(tagId);
  console.log('2. Product data:', product ? 'PASS' : 'FAIL');

  // Test 3: Blockchain verification
  const verification = await tagit.products.verify(tagId);
  console.log('3. Blockchain verified:', verification.verified ? 'PASS' : 'FAIL');

  // Test 4: Signature validation
  const sigValid = await tagit.security.validateSignature(tagId);
  console.log('4. Signature valid:', sigValid ? 'PASS' : 'FAIL');

  // Test 5: IPFS data availability
  const ipfsData = await tagit.storage.getIPFS(product.ipfsHash);
  console.log('5. IPFS available:', ipfsData ? 'PASS' : 'FAIL');

  const allPassed = tagExists && product && verification.verified && sigValid && ipfsData;
  console.log('\n' + (allPassed ? 'All tests passed!' : 'Some tests failed. Review above.'));

  return allPassed;
}

// Run verification
verifyInstallation('NFC-TAG-001-ABC');

Expected Output

Starting verification tests...

1. Tag registered: PASS
2. Product data: PASS
3. Blockchain verified: PASS
4. Signature valid: PASS
5. IPFS available: PASS

All tests passed!

Best Practices

Follow these best practices to ensure long-term success with your product tagging implementation.

Durability

Placement

Security

Security Reminder

Never share your API secret keys or tag encryption keys. Compromised keys can allow counterfeiters to create fraudulent products.

Batch Operations

For high-volume tagging operations:

import { TagIt } from '@tagit/sdk';

const tagit = new TagIt({
  apiKey: process.env.TAGIT_API_KEY,
  network: 'mainnet'
});

async function batchRegister(products) {
  const results = await tagit.products.batchRegister(products, {
    batchSize: 100, // Process 100 at a time
    retryOnFailure: true,
    webhookUrl: 'https://your-server.com/webhook/batch-complete'
  });

  console.log(`Registered ${results.successful} of ${products.length} products`);
  console.log(`Failed: ${results.failed}`);

  return results;
}

// Register 1000 products
const productBatch = generateProductBatch(1000);
await batchRegister(productBatch);
Congratulations!

You have successfully tagged and registered your first product on the TAG IT Network. Your product now has a verifiable digital identity on the blockchain.

Next Steps

Edit this page on GitHub
Type to search documentation...