Skip to content
Last updated

Subscription Events Table

One-Click Unsubscribe automatically records all unsubscribe events in a dedicated table within your email domain's database. This table allows you to track unsubscribe activity, analyze trends, and build workflows to exclude unsubscribed users from future campaigns.

Database and Table Location

Your subscription event data is stored in your Treasure Data account in the following location:

  • Database: delivery_email_{your-domain} (e.g., delivery_email_example_com)
  • Table: subscription_events

The subscription_events table is automatically created in the same database as your email delivery events when you enable TD Managed Unsubscribe.

Event Schema

The subscription_events table contains the following fields:

FieldTypeDescription
profile_identifier_valuestringThe recipient's email address
profile_identifier_namestringAlways "email_address" (for future multi-channel support)
campaign_idstringUnique ID of the campaign
campaign_namestringName of the campaign
group_idstringID of the subscription group (currently always NULL for global unsubscribe)
group_namestringName of the subscription group (currently always "Global")
actionstringCurrently always "opt-out" (opt-in functionality will be available in a future release)
action_sourcestringHow the unsubscribe was triggered: "post" (HTTPS) or "mailto" (email)
channelstringCurrently always "email" (SMS and push channel support will be available in future releases)
task_idstringUnique identifier for the email sent
user_agentstringBrowser/device information (HTTPS only)
ip_addressstringIP address of the user (HTTPS only)
senderstringEmail address of the sender
received_timetimestampWhen TD received the unsubscribe request
timetimestampAutomatically added by Plazma

Integration with Audience Studio

To use unsubscribe data in your campaigns, you need to integrate it as Attribute properties in your Parent Segment:

  1. Create a table of unsubscribed users from the subscription_events table
  2. Create an Attribute table with the opt-out flag
  3. Register this table as an Attribute table in your Parent Segment
  4. Use the Attribute in Audience Studio to filter out unsubscribed users when creating campaign audiences
-- Create a table of unsubscribed users
CREATE TABLE unsubscribed_users AS
SELECT
email, latest_action, last_updated, cast(1 as bigint) is_opt_out
FROM (
  SELECT
    profile_identifier_value AS email,
    MAX_BY(action, received_time) AS latest_action,
    MAX(received_time) AS last_updated
  FROM subscription_events
  WHERE group_name = 'Global'
  GROUP BY profile_identifier_value
  HAVING MAX_BY(action, received_time) = 'opt-out'
) t1