Overview
TrainFair empowers publishers to monetize their content when it's accessed by bots that scrape the web to power AI search. Our platform detects AI bots, verifies their access rights, and (once we officially launch) ensures you get compensated for your valuable content.
This guide will walk you through integrating TrainFair into your website, allowing you to:
- Detect when AI companies are accessing your content
- Block unauthorized AI crawlers
- Monetize your content through our marketplace
- Access detailed analytics on AI usage of your content
If you're in a hurry, the minimum integration requires just adding our script tag and a meta tag with your publisher ID to your website. The full installation takes less than 5 minutes.
Prerequisites
Before you begin integration, make sure you have:
- A TrainFair publisher account (create one here if you don't have one)
- Access to your website's HTML code or content management system
- Your unique Publisher ID (found in your TrainFair dashboard)
TrainFair integration requires your unique Publisher ID. Without it, the system cannot identify your content or attribute earnings to your account.
Integration Steps
Follow these steps to integrate TrainFair into your website:
Step 1: Add the TrainFair Script
Add the following script tag to the <head> section of your website's HTML:
<script src="https://trainfair-cdn.s3.us-east-2.amazonaws.com/scripts/latest/trainfair.js" async></script>
This script is lightweight, loads asynchronously, and won't impact your website's performance for regular users.
Step 2: Add Your Publisher ID
Add the following meta tag to the <head> section of your website, replacing YOUR_PUBLISHER_ID with your actual Publisher ID:
<meta name="tf-publisher-id" content="YOUR_PUBLISHER_ID">
Step 3: Verify Integration
After adding the script and meta tag, verify that TrainFair is working correctly:
- Visit your website in a new browser window or incognito mode.
- Open browser developer tools (F12 or right-click → Inspect).
- Check the browser console for a message like: [TrainFair]: Configuration loaded.
If you don't see this message, add the debug meta tag to enable verbose logging:
<meta name="tf-debug" content="true">
You can remove this meta tag once you've confirmed the integration is working.
Step 4: Configure Bot Blocking (Optional)
When enabled, unregistered AI bots will see a message directing them to register with TrainFair instead of accessing your content.
Step 5: Check Your Dashboard
- Which AI bots are accessing your content
- Which pages are most frequently accessed
- How much potential revenue you're generating
- Historical trends and patterns
The dashboard updates in real-time as AI crawlers access your content.
Advanced Configuration
Custom Content Selector
By default, TrainFair identifies your main content using common selectors (main
, article
, etc.). If your site uses different HTML structure, you can specify a custom selector by adding another meta tag:
<meta name="tf-content-selector" content=".my-content-class, #article-container">
This helps TrainFair accurately hide content from unauthorized bots and properly calculate token counts.
Integration with Content Management Systems
Here's how to integrate TrainFair with popular content management systems:
WordPress
Add the TrainFair script and meta tags to your theme's header.php
file, just before the closing </head>
tag, or use a plugin like "Header and Footer Scripts".
<script src="https://trainfair-cdn.s3.us-east-2.amazonaws.com/scripts/latest/trainfair.js" async></script>
<meta name="tf-publisher-id" content="YOUR_PUBLISHER_ID">
Frequently Asked Questions
Getting Support
If you need assistance with TrainFair integration or have questions, we're here to help:
- info@trainfair.io
- If you don't get a response from us immediately, harass our CEO: @RobCortinas