{"id":2408,"date":"2022-09-12T10:00:27","date_gmt":"2022-09-12T01:00:27","guid":{"rendered":"https:\/\/www.li1l.tokyo\/journal\/?p=2408"},"modified":"2024-07-10T16:27:48","modified_gmt":"2024-07-10T07:27:48","slug":"%e3%82%ae%e3%83%95%e3%83%88%e3%83%a9%e3%83%83%e3%83%94%e3%83%b3%e3%82%b0","status":"publish","type":"post","link":"https:\/\/www.li1l.tokyo\/journal\/2408","title":{"rendered":"\u30ae\u30d5\u30c8\u30e9\u30c3\u30d4\u30f3\u30b0"},"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', 2408);\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:\/\/www.li1l.tokyo\/journal\/wp-admin\/admin-ajax.php?action=ulpb_rc_current_usr_click&POPB_CTA_Nonce=51ed25b483\"\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":2,"featured_media":2410,"comment_status":"open","ping_status":"open","sticky":false,"template":"brizy-blank-template.php","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[265],"class_list":["post-2408","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","tag-265"],"acf":[],"aioseo_notices":[],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/posts\/2408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/comments?post=2408"}],"version-history":[{"count":33,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/posts\/2408\/revisions"}],"predecessor-version":[{"id":9129,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/posts\/2408\/revisions\/9129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/media\/2410"}],"wp:attachment":[{"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/media?parent=2408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/categories?post=2408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.li1l.tokyo\/journal\/wp-json\/wp\/v2\/tags?post=2408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}