在Javascript覆盖中使用虚拟页面视图

时间:2015-02-09 16:35:23

标签: javascript

我在我的custom.js中添加了几行代码,这些代码在使用虚拟页面视图的转化渠道报告中无法正常运行。

我想要运行两个虚拟页面视图;

hj('vpv','/ sign-up /');当生成叠加联系表单时 和

hj('vpv','/ thank-you /');提交表格时

我要么不在场,要么遗漏了什么。

http://inside.hotjar.com/support/solutions/articles/1000125864

function showEarlyAccessForm(){
    "use strict";
    $('.modal-title').html('Commercial Inquires');
    $('.modal-subtitle').html('The Safest & Most Effective Traction Agent');

    $('.error').removeClass('alert alert-danger').html('');
}

function openEarlyAccessModal(){
    "use strict";
    showEarlyAccessForm();
    $('#loginModal').modal('show');
    hj('vpv', '/sign-up/');
}

$(function() {
    $('#earlyaccess-modal').submit(function(event) {
        event.preventDefault();

        $.ajax({
            type: "POST",
            url: "assets/php/constantcontact.php",
            data: {
                'lm-first-name': $('#lm-first-name').val(),
                'lm-email': $('#lm-email').val(),
                'lm-phone': $('#lm-phone').val(),
                'lm-company': $('#lm-company').val(),
                'lm-comments': $('#lm-comments').val()
            },
            success: function(resp){
                $('.lm-success')
                .html('<i class="icon icon_check_alt2"></i>' + ' Thank you')
                .fadeIn(1000);

                $('.lm-failed').fadeOut(500);
                
                hj('vpv','/thank-you/');

                // Track conversion
                var google_conversion_id = 961104703;
                var google_conversion_language = "en";
                var google_conversion_format = "2";
                var google_conversion_color = "ffffff";
                var google_conversion_label = "TQRYCKjUnlkQv5alygM";
                var google_remarketing_only = false;
                $.getScript( "http://www.googleadservices.com/pagead/conversion.js" );

            },
            error: function(resp){
                $('.lm-failed')
                .html('<i class="icon icon_close_alt2"></i>')
                .fadeIn(1000);

                $('.lm-success').fadeOut(500);
            }
        });
    });
});

0 个答案:

没有答案