Custom Database Tables

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

{prefix}aop_traffic_visits — stores every individual visit record.

 

ColumnTypeDescription
idBIGINT UNSIGNEDAuto-increment primary key
sourceVARCHAR(255)Traffic source
mediumVARCHAR(255)Traffic medium
campaignVARCHAR(255)Campaign name
channelVARCHAR(100)Traffic channel
landing_pageTEXTLanding page path and query string
referrerVARCHAR(500)HTTP referrer
click_id_typeVARCHAR(50)Click ID type detected (e.g., gclid)
visitor_hashVARCHAR(64)Anonymous SHA-256 visitor hash
campaign_idBIGINT UNSIGNEDReference to campaigns table (nullable)
device_typeVARCHAR(20)Device type (desktop, mobile, tablet)
browserVARCHAR(50)Browser name
osVARCHAR(50)Operating system
is_new_visitorTINYINT(1)1 if this visitor hash has not been seen before
created_atDATETIMEWhen the visit was recorded

 

{prefix}aop_campaigns — stores campaign definitions.

ColumnTypeDescription
idBIGINT UNSIGNEDAuto-increment primary key
nameVARCHAR(255)Campaign display name
slugVARCHAR(255)URL-safe slug (unique)
sourceVARCHAR(255)utm_source value
mediumVARCHAR(255)utm_medium value
campaignVARCHAR(255)utm_campaign value
termVARCHAR(255)utm_term value
contentVARCHAR(255)utm_content value
statusVARCHAR(20)active, paused, or ended
goal_visitsINT UNSIGNEDTarget visit count
tagsVARCHAR(500)Comma-separated tags
start_dateDATECampaign start date (nullable)
end_dateDATECampaign end date (nullable)
notesTEXTInternal notes
created_atDATETIMECreation timestamp
updated_atDATETIMELast updated timestamp