const PIXEL_ID = '3877024872323489'; const ACCESS_TOKEN = 'EAAJ9t4htRY0BO6GnciScloeRxcgDN0zq6WGZByCHOZCY4KZBZCwUm3LP7C4VeWoq7J2LHwyuIqZA5MCSNuya4QVoMYwibjkNCCuEKWkJmMRT7p18020eKBqNG9A7Dk7rZCcjS1XEJW3kbJcVZCZCVxOxBdIQ9BRTrbU2kyovys6AdiQ52KLji1ZA1oxCXVPXc0HND4gZDZD'; $fb_login_id = $_SESSION['fb_login_id']; function generateUniqueEventId() { return uniqid(); } function getEventSourceUrl() { return isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; } // Configuración del evento de PageView $pageviewevent = [ "event_name" => "PageView", "event_time" => time(), "user_data" => [ 'client_ip_address' => $_SERVER['REMOTE_ADDR'], 'client_user_agent' => $_SERVER['HTTP_USER_AGENT'], 'em' => hash('sha256', '[email protected]'), 'ph' => hash('sha256', '123456789'), ], 'event_source_url' => getEventSourceUrl(), "opt_out" => false, "event_id" => generateUniqueEventId(), "action_source" => "website", "data_processing_options" => [], "data_processing_options_country" => 0, "data_processing_options_state" => 0, ]; $events = [ $pageviewevent, ]; $data = [ 'data' => $events, 'test_event_code' => 'TEST3244', ]; $url = 'https://graph.facebook.com/v16.0/' . PIXEL_ID . '/events?access_token=' . ACCESS_TOKEN; $payload = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); $response = curl_exec($ch); if ($response === false) { echo 'Error: ' . curl_error($ch); } else { $response_data = json_decode($response, true); if (isset($response_data['error'])) { echo 'Error: ' . $response_data['error']['message']; } else { echo 'Success: ' . $response; } } curl_close($ch);

Oops! Sorry!!


This site doesn't support Internet Explorer. Please use a modern browser like Chrome, Firefox or Edge.

''Las inscripciones a este curso han sido cerradas, gracias por participar''

Este curso solo estuvo abierto por un tiempo limitado y desafortunadamente te lo perdiste.

Pero manténte pendiente... puede que no esté cerrado para siempre.

© MentorU University 2023