Canvas LMS Integration
Integrate NotAI with Canvas Learning Management System to detect AI agents and bots accessing your courses. This guide walks Canvas administrators through installing the NotAI pixel via the Theme Editor to monitor student activity for automated access patterns.
Overview
The NotAI pixel integration for Canvas LMS enables you to:
- Detect AI agents accessing course content
- Monitor for automated quiz and assignment completion
- Identify bot activity in discussion boards
- Track unusual navigation patterns across your Canvas instance
Requirements
Before you begin, ensure you have:
- Canvas Admin Access: You need admin-level access to modify the Canvas theme
- NotAI Account: Sign up to get your account ID
Supported Canvas Versions
- Canvas Cloud (Instructure-hosted)
- Canvas Self-Hosted (all supported versions)
Installation
Install the NotAI pixel using the Canvas Theme Editor. This method works for both Canvas Cloud and self-hosted instances.
Step 1: Access the Theme Editor
- Log in to Canvas as an administrator
- Navigate to Admin → Your Account
- Click Themes in the left sidebar
- Select your active theme or create a new one
- Click Open in Theme Editor
Step 2: Add the NotAI Pixel
In the Theme Editor, navigate to the Upload tab and upload a custom JavaScript file, or use the CSS/JavaScript editor if available.
Add the following code to your custom JavaScript:
// NotAI Pixel for Canvas LMS
(function() {
const script = document.createElement('script');
script.src = 'https://cdn.isnotai.com/api.js';
script.setAttribute('data-key', 'your-account-id');
document.head.appendChild(script);
})();
Step 3: Save and Apply
- Click Save Theme
- Click Apply Theme to activate the changes
- The pixel will now load on all Canvas pages in your instance
Configuration
Customize the pixel behavior with these configuration options:
// NotAI Pixel with full configuration
(function() {
const script = document.createElement('script');
script.src = 'https://cdn.isnotai.com/api.js';
// Required: Your account ID from the NotAI dashboard
script.setAttribute('data-key', 'your-account-id');
// Data region — must match your account region (set at signup)
script.setAttribute('region', 'eu');
// Optional: Sampling rate (0.0 to 1.0)
script.setAttribute('data-sample', '1.0');
// Optional: Exclude admin pages from tracking
script.setAttribute('data-exclude', '/accounts/*,/admin/*');
document.head.appendChild(script);
})();
Configuration Options
| Attribute | Required | Default | Description |
|---|---|---|---|
data-key |
Yes | Your NotAI account ID | |
region |
No | us |
Data region: us or eu. Must match your account region (set at signup). |
data-sample |
No | 1.0 |
Sampling rate (0.0 to 1.0) |
data-exclude |
No | none | URL patterns to exclude (comma-separated) |
EU Data Region
For institutions requiring GDPR compliance with an EU data region:
script.setAttribute('region', 'eu');
Testing
Verify your NotAI pixel is working correctly after installation.
Step 1: Verify Script Loading
- Open any Canvas page in your browser
- Open Developer Tools (F12 or Cmd+Option+I)
- Go to the Network tab
- Filter by "pixel" or "isnotai.com"
- Confirm the script loads with a 200 status
Step 2: Verify in Dashboard
- Log in to your NotAI Dashboard
- Navigate to Sessions → Live View
- Look for sessions from your Canvas domain
- Confirm session data is being received
Use Cases
Common scenarios where NotAI helps Canvas administrators:
Quiz Integrity
Detect automated quiz-taking tools and AI agents attempting to answer quiz questions. The pixel analyzes behavior patterns during quiz sessions to identify non-human activity.
Discussion Board Monitoring
Identify bot-generated discussion posts and replies. AI agents often exhibit distinctive patterns when composing and submitting discussion content.
Assignment Access Patterns
Monitor how users access and navigate assignment content. Bots typically follow systematic, predictable patterns that differ from human browsing.
Content Scraping Detection
Detect automated tools scraping course materials, lecture content, or copyrighted resources from your Canvas instance.
Dashboard
View Canvas-specific detection data in your NotAI dashboard.
Canvas Metrics
- Total Sessions: All tracked Canvas sessions
- Human Verified: Sessions confirmed as human users
- AI Detected: Sessions flagged as AI agents
- Bot Detected: Traditional automation detected
- Page Types: Breakdown by course pages, quizzes, assignments, etc.
API Access
Query Canvas session data programmatically:
curl -X GET "https://<your-api-endpoint>/v1/pixel/sessions" \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json"
# Your API endpoint is shown in your dashboard under Settings → API
Troubleshooting
Pixel not loading
- Verify your account ID is correct in the script
- Ensure your Canvas domain is registered in the Allowed Hostnames list in your dashboard — requests from unregistered hostnames are rejected
- Check that the theme is active and applied
- Clear your browser cache and reload
- Check for JavaScript errors in the browser console
- Ensure Content Security Policy (CSP) allows the CDN domain (e.g.
cdn.jsdelivr.net)
No data in dashboard
- Confirm the page's hostname matches one of your Allowed Hostnames in the dashboard (e.g.
yourschool.instructure.com) — traffic from unrecognized domains is filtered automatically - Wait 5-10 minutes for initial data to appear
- Verify the page URL isn't in the exclude list
- Check that sampling rate isn't set too low
Content Security Policy (CSP) errors
If your Canvas instance has strict CSP headers, you may need to add NotAI domains to your CSP allowlist:
script-src 'self' https://cdn.jsdelivr.net;
connect-src 'self' https://<your-api-endpoint>; # from your dashboard
Theme changes not appearing
- Ensure you clicked both "Save Theme" and "Apply Theme"
- Wait a few minutes for changes to propagate
- Try viewing in an incognito/private browser window
- Check that no other themes are overriding your changes
False positives
- Users with accessibility tools may trigger detection
- Remote desktop or virtual machine users may show bot-like patterns
- Adjust detection sensitivity in your NotAI dashboard settings
- Review flagged sessions to tune your configuration
Performance concerns
- The pixel script is under 5KB gzipped
- Async loading doesn't block Canvas page rendering
- Data is sent in batches to minimize network requests
- Use sampling for high-traffic Canvas instances