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
Privacy First: NotAI does not capture personal information, form content, or passwords. We only analyze behavioral patterns to distinguish humans from bots.

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)
Note: Canvas Free for Teachers does not support custom themes or custom JavaScript uploads, so this integration is not available for free-tier accounts.

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

  1. Log in to Canvas as an administrator
  2. Navigate to AdminYour Account
  3. Click Themes in the left sidebar
  4. Select your active theme or create a new one
  5. 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:

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

  1. Click Save Theme
  2. Click Apply Theme to activate the changes
  3. The pixel will now load on all Canvas pages in your instance
Note: Theme changes may take a few minutes to propagate across all Canvas pages. Clear your browser cache if you don't see immediate changes.

Configuration

Customize the pixel behavior with these configuration options:

JavaScript
// 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:

JavaScript
script.setAttribute('region', 'eu');

Testing

Verify your NotAI pixel is working correctly after installation.

Step 1: Verify Script Loading

  1. Open any Canvas page in your browser
  2. Open Developer Tools (F12 or Cmd+Option+I)
  3. Go to the Network tab
  4. Filter by "pixel" or "isnotai.com"
  5. Confirm the script loads with a 200 status

Step 2: Verify in Dashboard

  1. Log in to your NotAI Dashboard
  2. Navigate to SessionsLive View
  3. Look for sessions from your Canvas domain
  4. Confirm session data is being received
Tip: It may take 5–10 minutes for initial session data to appear in your dashboard after installation.

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
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:

CSP Header
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
Need more help? Contact our support team at [email protected]