PageSourceSearch

https://www.naraoa.co.jp/js/noamarket.js

js naraoa.co.jp collected 2026-10-05 10:37:16 UTC 8,031 bytes, 189 lines download raw bytes

1$(function () {
2    getVisitorCountry();
3    trackPageVisit();// Attach click event listeners to all links-すべてのリンクにクリック イベント リスナーをアタッチする
4    getVisitorIp();
5    setInterval(function () {
6        trackPageVisit();
7    }, 15000);
8
9});
10
11/*----------------------------- 
12 * @param {type} $visitedPages
13 * @returns country detail
14 *----------------------------*/
15function getVisitorCountry() {
16    $.getJSON('https://ipinfo.io/json', function (data) {
17        //console.log('Visitor Location:', data);
18        // Here 'data' will contain the visitor's location information
19        // You can access country, region, city, etc. from this data object
20        // For example:
21        var country = data.country;
22        var region = data.region;
23        var city = data.city;
24        let $country = city + ', ' + region + ', ' + country;
25        sessionStorage.setItem("country", $country);
26    });
27}
28
29/*----------------------------- 
30 * @param {type} $visiterIp
31 * @returns Ip detail
32 *----------------------------*/
33function getVisitorIp() {
34    $.getJSON("https://api.ipify.org?format=json", function (data) {
35        var $ipAddress = data.ip;
36        // Send IP address to server
37        sessionStorage.setItem("CIP", $ipAddress);
38    });
39}
40
41/*-------------------------------------
42 * Function to track page visit time
43 * ページ訪問時間を追跡する機能 
44 *-----------------------------------*/
45function trackPageVisit() {
46    var $TCID = getTrackQueryParameter('PCID');
47    if ($TCID !== '' && $TCID !== null) {
48        setCookie('TCID', $TCID, '365');//set cookies for one year-1 年間の Cookie を設定する   
49    }
50
51    const $TEID = getTrackQueryParameter('PEID');//Get event id-イベントIDを取得する
52    if ($TEID !== '' && $TEID !== null) {
53        sessionStorage.setItem("TEID", $TEID);//Set session for event id-イベントIDのセッションを設定する 
54    }
55
56    const $TMID = getTrackQueryParameter('PMID');//Get mail id-メールIDを取得する
57    if ($TMID !== '' && $TMID !== null) {
58        setCookie('TMID', $TMID, '365');//set cookies for one month 年間の Cookie を設定する 
59    }
60
61    const $CPTCID = getCookie('TCID');//Get customer id-顧客IDを取得します 
62    const $PTCID = $CPTCID !== 'null' ? $CPTCID : 'anonymous';//Get customer id-顧客IDを取得します 
63    const $CPTMID = getCookie('TMID');//Get mail id-メールIDを取得する
64    const $PTMID = $CPTMID ? $CPTMID : '';
65    //Get mail id-メールIDを取得する
66    const $PTEID = sessionStorage.getItem('TEID');//Get event id-イベントIDを取得する
67    const $pageName = window.location.href.split('?')[0];//Get the current page's name or identifier-現在のページの名前または識別子を取得します 
68    var $country = sessionStorage.getItem('country');
69    let $CIP = sessionStorage.getItem('CIP');//customer ip address
70    /*-----------track time start------------*/
71    let $trackedpage = JSON.parse(getCookie($PTCID)) || {};
72    var $date = setDateFormat();
73    var $CheckcurrentTime = new Date();//Track the page visit and time spent-ページの訪問と滞在時間を追跡する 
74    // Extract hour, minute, and second
75    var $current_hour = $CheckcurrentTime.getHours();
76    var $current_minute = $CheckcurrentTime.getMinutes();
77    var $current_second = $CheckcurrentTime.getSeconds();
78    var $currentTime = $current_hour + ":" + $current_minute + ":" + $current_second;
79    /*---------------end time----------*/
80    var $checkEndTime = new Date();
81    var $end_hour = $checkEndTime.getHours();
82    var $end_minute = $checkEndTime.getMinutes();
83    var $end_second = $checkEndTime.getSeconds();
84    var $endTime = $end_hour + ":" + $end_minute + ":" + $end_second;
85    if (!$trackedpage[$pageName]) {
86        //$trackedpage[$pageName] = {ptcid: $PTCID, pteid:$PTEID, ptpid: $PTPID, ptqid: $PTQID, start_time: $currentTime,end_time:$endTime, linkId: $pageName,address:$country,date:$date};
87        $trackedpage[$pageName] = {ptcid: $PTCID, pteid: $PTEID, ptmid: $PTMID, cip: $CIP, start_time: $currentTime, end_time: $endTime, linkId: $pageName, address: $country, date: $date};
88    } else {
89        $trackedpage[$pageName].ptcid = $PTCID;
90        $trackedpage[$pageName].pteid = $PTEID;
91        $trackedpage[$pageName].ptmid = $PTMID;
92        $trackedpage[$pageName].address = $country;
93        $trackedpage[$pageName].cip = $CIP;
94        if ($date !== $trackedpage[$pageName].date) {
95            $trackedpage[$pageName].start_time = $currentTime;
96            $trackedpage[$pageName].date = $date;
97        }
98        $trackedpage[$pageName].end_time = $endTime;
99    }
100    setCookie($PTCID, JSON.stringify($trackedpage), '1');//set cookies for one day
101    sendDataToServer($trackedpage[$pageName]);// Send data to server
102    /*-----------track time end------------*/
103}
104
105
106/*---------------------------------------- 
107 * Function to set a cookie with name
108 * クッキーに名前を付ける機能
109 * --------------------------------------*/
110function setCookie($name, $value, $days) {
111    var $expires = "";
112    if ($days) {
113        var $date = new Date();
114        $date.setTime($date.getTime() + ($days * 24 * 60 * 60 * 1000));
115        $expires = "; expires=" + $date.toUTCString();
116    }
117    document.cookie = $name + "=" + $value + $expires + "; path=/";
118}
119
120/*------------------------------------
121 * Function to get a cookie with name
122 * 名前付きクッキーを取得する関数
123 * ----------------------------------*/
124function getCookie($name) {
125    var $nameEQ = $name + "=";
126    var $cookies = document.cookie.split(';');
127    for (var i = 0; i < $cookies.length; i++) {
128        var $cookie = $cookies[i];
129        while ($cookie.charAt(0) === ' ') {
130            $cookie = $cookie.substring(1, $cookie.length);
131        }
132        if ($cookie.indexOf($nameEQ) === 0) {
133            return $cookie.substring($nameEQ.length, $cookie.length);
134        }
135    }
136    return null;
137}
138
139/*-----------------------------------
140 * function track link and parameter
141 * 関数トラックのリンクとパラメータ
142 * ---------------------------------*/
143function getTrackQueryParameter(name) {
144    const $urlParams = new URLSearchParams(window.location.search);
145    return $urlParams.get(name);
146}
147
148/*-----------------------------
149 * @param {type} $visitedPages
150 * @returns current date 
151 *------------------------*/
152function setDateFormat() {
153    var $date = new Date();
154    var $Y = parseInt($date.getFullYear()) + "-";
155    var $M = parseInt($date.getMonth()) + 1 + "-";
156    var $D = parseInt($date.getDate());
157    return  String($Y) + String($M) + String($D);
158}
159
160/*------------------------------------
161 * Function to send data to database
162 * データベースにデータを送信する機能
163 * ----------------------------------*/
164function sendDataToServer($visitedPages) {
165    var $uploadurl = "https://market.naraoa.co.jp/home/pagetrack";
166    var $formdata = new FormData();
167    $formdata.append("ptcid", $visitedPages.ptcid);//Get customer id-顧客IDを取得します 
168    $formdata.append("pteid", $visitedPages.pteid);//Get event id-イベントIDを取得する
169    $formdata.append("ptmid", $visitedPages.ptmid);//Get mail id-メールIDを取得する
170    $formdata.append("link", $visitedPages.linkId);//Get page name-ページ名の取得
171    $formdata.append("start_time", $visitedPages.start_time);//Get start time
172    $formdata.append("end_time", $visitedPages.end_time);//Get end time
173    $formdata.append("address", $visitedPages.address);//Get end time
174    $formdata.append("date", $visitedPages.date);//Get date
175    $formdata.append("cip", $visitedPages.cip);//Get date
176    var $postData = {
177        type: "POST",
178        dataType: "json",
179        data: $formdata,
180        processData: false,
181        contentType: false,
182        async: false
183    };
184    $.ajax($uploadurl, $postData).done(function ($result, $status) {
185        if ($status === 'success') {
186        } else {
187        }
188    });
189}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.