@daeryun/dr_components 0.4.80 → 0.4.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,23 @@
1
1
  export function insert(str, isMobile) {
2
- const sendData = { site_gubun: "regener", location: window.location, userAgent: navigator.userAgent, referrer: document.referrer, conversion: str, isMobile: isMobile };
2
+ const url = String(window.location);
3
+ let gubun = 'localhost';
4
+ const split = url.split('daeryunlaw-');
5
+ if (split.length > 1) {
6
+ gubun = split[1].split('.com')[0];
7
+ }
8
+ const sendData = {
9
+ site_gubun: gubun,
10
+ location: window.location,
11
+ userAgent: navigator.userAgent,
12
+ referrer: document.referrer,
13
+ conversion: str,
14
+ isMobile: isMobile
15
+ };
3
16
  let myHeaders = new Headers();
4
- myHeaders.append("Content-Type", "application/json");
5
- fetch("https://mng.daeryunlaw.com/api/conversion", { method: "POST", body: JSON.stringify(sendData), headers: myHeaders });
17
+ myHeaders.append('Content-Type', 'application/json');
18
+ fetch('https://mng.daeryunlaw.com/api/conversion', {
19
+ method: 'POST',
20
+ body: JSON.stringify(sendData),
21
+ headers: myHeaders
22
+ });
6
23
  }
@@ -1,6 +1,25 @@
1
- export function insert(str:string, isMobile:boolean){
2
- const sendData = { site_gubun: "regener", location: window.location, userAgent: navigator.userAgent, referrer: document.referrer, conversion: str, isMobile: isMobile}
1
+ export function insert(str: string, isMobile: boolean) {
2
+ const url = String(window.location);
3
+ let gubun = 'localhost';
4
+ const split = url.split('daeryunlaw-');
5
+ if (split.length > 1) {
6
+ gubun = split[1].split('.com')[0];
7
+ }
8
+
9
+ const sendData = {
10
+ site_gubun: gubun,
11
+ location: window.location,
12
+ userAgent: navigator.userAgent,
13
+ referrer: document.referrer,
14
+ conversion: str,
15
+ isMobile: isMobile
16
+ };
17
+
3
18
  let myHeaders = new Headers();
4
- myHeaders.append("Content-Type", "application/json");
5
- fetch("https://mng.daeryunlaw.com/api/conversion", {method: "POST", body: JSON.stringify(sendData), headers: myHeaders});
6
- }
19
+ myHeaders.append('Content-Type', 'application/json');
20
+ fetch('https://mng.daeryunlaw.com/api/conversion', {
21
+ method: 'POST',
22
+ body: JSON.stringify(sendData),
23
+ headers: myHeaders
24
+ });
25
+ }