'D3B7NQ3C77U2R2QSK050', 'event' => $eventData['event'], 'event_id' => $eventData['eventId'], 'timestamp' => time(), 'user_data' => [ 'email' => $hashedEmail, 'client_ip_address' => $eventData['ip'], 'client_user_agent' => $eventData['userAgent'] ], 'custom_data' => [ 'value' => $eventData['value'], 'currency' => 'BRL' ], 'partner_agent' => 'MeuPHPApp-v1' ]); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://business-api.tiktok.com/portal/v1.3/track/web'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $body); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: Bearer 1eee071cdacb8002ae764e84f21ba107fa48115f', 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return json_decode($response, true); } // Uso: $result = sendTikTokEvent(['event' => 'Purchase', 'email' => 'user@example.com', 'value' => 99.99, 'ip' => $_SERVER['REMOTE_ADDR'], 'userAgent' => $_SERVER['HTTP_USER_AGENT'], 'eventId' => uniqid()]); ?>