PageSourceSearch

https://soulbeauty.jp/app/wp-content/themes/drop_tcd087/admin/js/cta.js?ver=2.0.1

js soulbeauty.jp collected 2026-09-24 15:05:15 UTC 3,362 bytes, 145 lines download raw bytes

1jQuery(document).ready(function($) {
2
3	// インプレッション、クリック率、コンバージョン率
4	$('#js-cta').on('inview', function(event, isinview) {
5
6		var cta_index;
7		if ($(this).hasClass('p-cta--1')) {
8			cta_index = 1;
9		} else if ($(this).hasClass('p-cta--2')) {
10			cta_index = 2;
11		} else {
12			cta_index = 3;
13		}
14
15		if (isinview) {
16			$.ajax({
17				type: 'post',
18				url: tcd_cta.admin_url,
19				data: {
20					'action' : 'tcd_cta_impression',
21					'security' : tcd_cta.ajax_nonce,
22					'cta_index' : cta_index
23				},
24				success: function(response) {
25					//console.log('success');
26				},
27				error: function() {
28					//console.log('error');
29				},
30				complete: function() {
31					//console.log('complete');
32				}
33			});
34			// 1度の表示でカウントは1回までのため、inview をオフにする
35			$('#js-cta').off('inview');
36		}
37	});
38
39	// クリック数、クリック率、Cookie
40	$('#js-cta__btn').click(function() {
41
42		var cta_index;
43		var cta = $(this).parents('#js-cta');
44
45		if (cta.hasClass('p-cta--1')) {
46			cta_index = 1;
47		} else if (cta.hasClass('p-cta--2')) {
48			cta_index = 2;
49		} else {
50			cta_index = 3;
51		}
52
53		$.ajax({
54			type: 'post',
55			url: tcd_cta.admin_url,
56			data: {
57				'action' : 'tcd_cta_click',
58				'security' : tcd_cta.ajax_nonce,
59				'cta_index' : cta_index
60			},
61			success: function(response) {
62				//console.log('success');
63			},
64			error: function() {
65				//console.log('error');
66			},
67			complete: function() {
68				//console.log('complete');
69			}
70		});
71	});
72
73	// コンバージョン、コンバージョン率
74	$('#js-cta-conversion').on('inview', function(event, isinview) {
75
76		if (isinview) {
77			$.ajax({
78				type: 'post',
79				url: tcd_cta.admin_url,
80				data: {
81					'action' : 'tcd_cta_conversion',
82					'security' : tcd_cta.ajax_nonce,
83				},
84				success: function(response) {
85					//console.log('success');
86				},
87				error: function() {
88					//console.log('error');
89				},
90				complete: function() {
91					//console.log('complete');
92				}
93			});
94			// inview をオフにする
95			$('#js-cta-conversion').off('inview');
96		}
97	});
98
99	// リセット
100	$('.js-cta-reset').click(function(event) {
101
102		var table = $(this).parents('.c-ab-table');
103
104		event.preventDefault();
105
106		if (window.confirm(tcd_cta.confirm_text)) {
107
108			// リセットする記事下CTAの番号			
109			var cta_index = $(this).data('cta-index');
110
111			$.ajax({
112				type: 'post',
113				url: tcd_cta.admin_url,
114				data: {
115					'action' : 'tcd_cta_reset',
116					'security' : tcd_cta.ajax_nonce,
117					'cta_index' : cta_index
118				},
119				success: function(response) {
120					
121					// 見た目上の値を変更すべきテーブルの行を取得
122					var abTableRow = table.find('.c-ab-table__row').eq(cta_index);
123					
124					// インプレッション、クリック数、クリック率、コンバージョン数、コンバージョン率の数値を0にする
125					abTableRow.find('.c-ab-table__impression').text('0');
126					abTableRow.find('.c-ab-table__click').text('0');
127					abTableRow.find('.c-ab-table__ctr').text('0%');
128					abTableRow.find('.c-ab-table__conversion').text('0');
129					abTableRow.find('.c-ab-table__cvr').text('0%');
130					
131					//console.log('success');
132				},
133				error: function() {
134					//console.log('error');
135				},
136				complete: function() {
137					//console.log('complete');
138				}
139			});
140
141		}
142
143	});
144
145});

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.