# 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: | Field | Type | Description | | --- | --- | --- | | `profile_identifier_value` | string | The recipient's email address | | `profile_identifier_name` | string | Always "email_address" (for future multi-channel support) | | `campaign_id` | string | Unique ID of the campaign | | `campaign_name` | string | Name of the campaign | | `group_id` | string | ID of the subscription group (currently always NULL for global unsubscribe) | | `group_name` | string | Name of the subscription group (currently always "Global") | | `action` | string | Currently always "opt-out" (opt-in functionality will be available in a future release) | | `action_source` | string | How the unsubscribe was triggered: "post" (HTTPS) or "mailto" (email) | | `channel` | string | Currently always "email" (SMS and push channel support will be available in future releases) | | `task_id` | string | Unique identifier for the email sent | | `user_agent` | string | Browser/device information (HTTPS only) | | `ip_address` | string | IP address of the user (HTTPS only) | | `sender` | string | Email address of the sender | | `received_time` | timestamp | When TD received the unsubscribe request | | `time` | timestamp | Automatically 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 ```sql -- 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 ``` ## Related Documentation - [One-Click Unsubscribe Management](/products/marketing-cloud/engage-studio/channels/email/one-click-unsubscribe) - [Email Delivery Events Table](/products/marketing-cloud/engage-studio/channels/email/email-delivery-events-table) - [Email Sender Configuration](/products/marketing-cloud/engage-studio/channels/email/email-sender-configuration)