{"id":1,"date":"2024-10-07T14:52:02","date_gmt":"2024-10-07T14:52:02","guid":{"rendered":"https:\/\/missuniverse.brightflixx.com\/?p=1"},"modified":"2024-10-07T14:52:02","modified_gmt":"2024-10-07T14:52:02","slug":"hello-world","status":"publish","type":"post","link":"https:\/\/missuniverse.brightflixx.com\/?p=1","title":{"rendered":"Hello world!"},"content":{"rendered":"<h3> Please add some content in your page.<\/h3>\r\n\r\n<script type=\"text\/javascript\">\r\n\t\t \t\/\/ Listen for clicks on the entire document\r\n\t\t\tdocument.addEventListener('click', function(event) {\r\n\t\t\t\tconsole.log(event.target.dataset)\r\n\r\n\t\t\t\t\/\/ Check if the clicked element has the 'track-click' class\r\n\t\t\t\tif (event.target.classList.contains('trk-clk-ulbp')) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t\/\/ Get the unique ID from the data-id attribute\r\n\t\t\t\t\tconst elementTxt = event.target.dataset.btntxt;\r\n          const elementUrl = event.target.dataset.btnhref;\r\n\r\n\t\t\t\t\t\/\/ Create a FormData object to send data\r\n\t\t\t\t\tconst formData = new FormData();\r\n\t\t\t\t\tformData.append('clicked_element_text', elementTxt);\r\n          formData.append('clicked_element_url', elementUrl);\r\n          formData.append('clicked_element_psid', 1);\r\n          \/\/console.log(formData.get('clicked_element_psid'));\r\n\t\t\t\t\t\/\/ Use the Fetch API to send the data to our PHP script\r\n\t\t\t\t\tfetch(\r\n              \"https:\/\/missuniverse.brightflixx.com\/wp-admin\/admin-ajax.php?action=ulpb_rc_current_usr_click&POPB_CTA_Nonce=66d2b5c853\"\r\n            , {\r\n\t\t\t\t\t\tmethod: 'POST',\r\n\t\t\t\t\t\tbody: formData\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.then(response => response.text())\r\n\t\t\t\t\t.then(data => {\r\n\t\t\t\t\t\tconsole.log(data); \/\/ Log the response from PHP (e.g., \"Success!\")\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.catch(error => {\r\n\t\t\t\t\t\tconsole.error('Error tracking click:', error);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\t\r\n\t\t<\/script>\r\n\r\n<!-- <style type=\"text\/css\">\r\n  <\/style> -->\r\n\r\n<\/html>","protected":false},"excerpt":{"rendered":"<p>Please add some content in your page.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1"}],"version-history":[{"count":0,"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=\/wp\/v2\/posts\/1\/revisions"}],"wp:attachment":[{"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/missuniverse.brightflixx.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}