graph TD
A[TrackingSetupAgent Start] --> B[Parse Input Requirements]
B --> C[UTM Parameter Setup]
B --> D[Pixel Tracking Setup]
C --> E[Generate UTM Structure]
C --> F[Create Implementation Guide]
D --> G[Define Event Listeners]
D --> H[Create Tracking Functions]
E --> I[Build tracking_details.txt]
F --> I
G --> J[Build tiktok_mastery_pixel.js]
H --> J
I --> K{Validate UTM Format}
J --> L{Test Pixel Code}
K -->|Pass| M[Save tracking_details.txt]
K -->|Fail| C
L -->|Pass| N[Save tiktok_mastery_pixel.js]
L -->|Fail| D
M --> O[TrackingSetupAgent Complete]
N --> O