Custom Database Tables

The plugin creates two custom database tables on activation using dbDelta.

{prefix}aop_traffic_visits — stores every individual visit record.

 

Column Type Description
id BIGINT UNSIGNED Auto-increment primary key
source VARCHAR(255) Traffic source
medium VARCHAR(255) Traffic medium
campaign VARCHAR(255) Campaign name
channel VARCHAR(100) Traffic channel
landing_page TEXT Landing page path and query string
referrer VARCHAR(500) HTTP referrer
click_id_type VARCHAR(50) Click ID type detected (e.g., gclid)
visitor_hash VARCHAR(64) Anonymous SHA-256 visitor hash
campaign_id BIGINT UNSIGNED Reference to campaigns table (nullable)
device_type VARCHAR(20) Device type (desktop, mobile, tablet)
browser VARCHAR(50) Browser name
os VARCHAR(50) Operating system
is_new_visitor TINYINT(1) 1 if this visitor hash has not been seen before
created_at DATETIME When the visit was recorded

 

{prefix}aop_campaigns — stores campaign definitions.

Column Type Description
id BIGINT UNSIGNED Auto-increment primary key
name VARCHAR(255) Campaign display name
slug VARCHAR(255) URL-safe slug (unique)
source VARCHAR(255) utm_source value
medium VARCHAR(255) utm_medium value
campaign VARCHAR(255) utm_campaign value
term VARCHAR(255) utm_term value
content VARCHAR(255) utm_content value
status VARCHAR(20) active, paused, or ended
goal_visits INT UNSIGNED Target visit count
tags VARCHAR(500) Comma-separated tags
start_date DATE Campaign start date (nullable)
end_date DATE Campaign end date (nullable)
notes TEXT Internal notes
created_at DATETIME Creation timestamp
updated_at DATETIME Last updated timestamp