Overview
The tag system provides a flexible way to categorize and organize links across clients and campaigns. Tags work independently of the client-campaign hierarchy, allowing you to create cross-cutting categories for filtering and analysis.Many-to-Many
Links can have multiple tags, tags can be on multiple links
Auto-Creation
Tags are created automatically when first used
Flexible Categories
Create any categorization scheme that fits your workflow
Cross-Client
Tags work across all clients and campaigns
How Tags Work
Many-to-Many Relationships
Tags and links have a many-to-many relationship:- A single link can have multiple tags
- A single tag can be applied to multiple links
- Tags are reusable across all links
Database Structure
Tags are implemented using a junction table for optimal performance:The junction table pattern ensures efficient querying in both directions:
- Find all tags for a link
- Find all links with a specific tag
Auto-Creation of Tags
One of the most powerful features of the tag system is automatic creation. You don’t need to pre-define tags.How Auto-Creation Works
Example: Creating Link with New Tags
- Three new tags are created: “social”, “instagram”, “new-product”
- All three tags are associated with the new link
- These tags are now available for other links
Using Tags with Links
Adding Tags to New Links
Include tags when creating a link:Updating Tags on Existing Links
Replace all tags on a link:Removing All Tags
Set tags to an empty array:Viewing Tags on Links
When retrieving link information, tags are included:Tag Naming Best Practices
Recommended Conventions
Lowercase
Use lowercase for consistency:
instagram not InstagramHyphen Separators
Use hyphens for multi-word tags:
new-product not new_productDescriptive
Make tags self-explanatory:
q1-2024 not q1Consistent Categories
Define category prefixes:
channel-email, channel-socialTag Naming Examples
- Good
- Avoid
Tag Organization Strategies
By Channel
Tag links by marketing channel:By Content Type
Categorize by the type of content:By Audience
Segment by target audience:By Status or Priority
Track the state or importance:By Traffic Source
Identify where links are shared:By Time Period
Group by temporal categories:Tag Lifecycle
Creation
Tags are created in two ways:- Automatically when first used with a link
- Reused if they already exist
Persistence
Tags persist even after all links using them are deleted. This means:- Tag history is preserved
- Reusing old tag names is seamless
- No need to recreate common tags
Deletion Behavior
Tag-link associations are automatically cleaned up:- Link Deleted
- Tag Deleted
When a link is deleted:
- The link-tag associations are removed from the junction table
- The tags themselves remain in the database
- Other links using these tags are unaffected
Querying by Tags
Finding Links with Specific Tags
While not explicitly shown in the routes, tags can be used in search queries:- The URL contains “instagram”
- A tag name contains “instagram”
- Other metadata matches “instagram”
Multiple Tag Filtering
For advanced filtering, you can retrieve all links and filter client-side, or implement custom API filters:Advanced Tag Patterns
Hierarchical Tags
Use prefixes to create pseudo-hierarchies:Composite Tags
Combine multiple concepts:Boolean Tag Patterns
Use tags as flags:Tag Analytics
Tags enable powerful analytics queries:Popular Tags
Find which tags are used most frequently:Performance by Tag
Compare click performance across tags:Tag Combinations
Discover common tag pairings:Tag Management UI Patterns
Tag Input Methods
Text Input
Comma-separated tag names:
social, instagram, paidAutocomplete
Suggest existing tags as user types
Tag Pills
Visual chips with remove buttons
Tag Browser
Browse and select from all existing tags
Visual Representations
- Tag Clouds: Show popular tags with size representing usage
- Color Coding: Assign colors to tag categories
- Tag Groups: Organize tags into collapsible categories
- Tag Counters: Display link count for each tag
Common Use Cases
Marketing Campaign Tracking
A/B Testing
Content Organization
Partner Tracking
Best Practices Summary
Start Simple
Begin with basic tags and expand as needs grow
Document Conventions
Maintain a tag naming guide for your team
Regular Review
Periodically audit tags to identify unused or redundant ones
Train Team
Ensure all users understand the tagging system
