diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 0d677f9..8ba8c45 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -171,6 +171,7 @@ 'success' => true, 'message' => 'Success message', 'alert' => $alert, + 'type' => $type, ]; } else { Yii::$app->response->setStatusCode(500); diff --git a/frontend/web/js/modal.js b/frontend/web/js/modal.js index c12d3b6..f66a264 100755 --- a/frontend/web/js/modal.js +++ b/frontend/web/js/modal.js @@ -59,6 +59,9 @@ $( data: formData, success: function(data) { f.reset(); + if (data.type == 'appointment') { + dataLayer.push({'event': 'mainFormSub'}); + } // form.replaceWith(data.alert) // $(".modal-dialog").append(data.alert); // setTimeout(function(){location.reload()}, 5000); @@ -66,8 +69,7 @@ $( $(".success_").animate({opacity: 1, top: '40'}, 200).addClass("done_"); setTimeout(function(){$(".success_").animate({opacity: 0, top: '0'}, 200,function(){ $(this).removeClass("done_"); - })}, 4000); - + })}, 4000) }, error: function() { -- libgit2 0.21.4