Google Ads sẽ khuyên bạn cài đặt điều kiện khi để lại thông tin thì cần đúng số điện thoại mới tính là chuyển đổi, mình thấy cũng không cần thiết lắm, vì theo dõi data các website mình chạy ads, mình cũng chưa thấy ai để lại số điện thoại sai bao giờ :)), nhưng mà thôi, sếp đã yêu cầu thì mình làm
Sau đây là mấy bước để bạn cài đặt điều kiện quy định người dùng phải điển đủ 10 số điện thoại đúng theo số điện thoại Việt Nam thì mới cho gửi.
Bước 1: Cài plugin Code Spippet nếu web chưa có>> kích hoạt, có rồi thì bỏ qua bước đó, copy đoạn code dưới đây rồi vào Code Snippets>> Header and Footer, dán vào footer rồi lưu lại
<script>const phoneReg=new RegExp(atob("XigwfFwrODQpKDN8NXw3fDh8OSlcZHs4fSQ="));jQuery(document).ready(function($){console.log('-------- validate check -----------');$(document).on('click','.ff-btn-submit',function(e){console.log('submit form clicked');e.preventDefault();const parent=$(this).closest('form');let isValid=!0;parent.find('.phone_number_valid').each(function(_,el){const value=$(el).val().trim();if(!phoneReg.test(value)){isValid=!1;$(el).closest('.ff-el-group').addClass('ff-el-is-error');$(el).attr('aria-invalid','true');$(el).parent().find('.error').remove();$(el).parent().append(`<div class="error text-danger" role="alert">Số điện thoại không đúng, bạn vui lòng kiểm tra lại</div>`)}else{$(el).closest('.ff-el-group').removeClass('ff-el-is-error');$(el).attr('aria-invalid','false');$(el).parent().find('.error').remove()}});if(isValid){parent.submit()}else{console.log('❌ Form có lỗi — không gửi')}})});</script>Bước 2: Vào Fluentform, chọn form cần sửa, bấm vào phần số điện thoại, góc phải sẽ có phần “Tùy chọn nâng cao”, bấm vào đó, tìm “Lớp phần tử “ rồi điền code sau vào: phone_number_valid

Web mình làm thường sẽ có 3 form, cứ sửa hết cả 3 form nhé
Xong hết thì lưu lại, nhớ xóa cache rồi test thử nhé



