[英]Does Sweetalert work in Google Tag Manager?
I have been copying and pasting code from Sweetalert into Google Tag Manager.我一直在将代码从 Sweetalert 复制并粘贴到 Google 跟踪代码管理器中。 It doesn't appear at preview and after submit onto website it doesn't apper.
它不会出现在预览中,提交到网站后也不会出现。 Does Sweetlart works in Google Tag Manager?
Sweetlart 是否适用于 Google 跟踪代码管理器? (I'm very new to this)
(我对此很陌生)
What I did:我做了什么:
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
and triggering: All page view.并触发:所有页面视图。 Tag firing options: Once per event
代码触发选项:每个事件一次
<script> swal.fire({ title: "Do you need any consultancy service?", text: "Let's", type: "info", confirmButtonColor: '#000000', confirmButtonClass: "contactMeNow_popUpButton", confirmButtonText: "Contact Me Now", closeOnConfirm: true, }); </script>
with Tag firing options: Once per event Tag Sequencing: Sweetalert source code (above) Triggering: All page load Window load.带有标签触发选项:每个事件一次标签排序:Sweetalert 源代码(上图)触发:所有页面加载 Window 加载。
Does sweetalert works with Google Tag Manager? sweetalert 可以与 Google 跟踪代码管理器一起使用吗? Have I done something wrong in the script or in setting?
我在脚本或设置中做错了什么吗?
Thank you so much for your reply in advance.非常感谢您提前回复。
check the console error in chrome devtool
.检查
chrome devtool
中的控制台错误。 There might be some error if this doesn't work.如果这不起作用,可能会出现一些错误。
modify the code a bit to check the swal
is exist稍微修改代码以检查
swal
是否存在
<script>
// try to console this variable is exist or not
console.log(typeof swal)
console.log(swal)
swal.fire({
title: "Do you need any consultancy service?",
text: "Let's",
type: "info",
confirmButtonColor: '#000000',
confirmButtonClass: "contactMeNow_popUpButton",
confirmButtonText: "Contact Me Now",
closeOnConfirm: true,
});
</script>
The reason might be even if you fire the js tag earlier.原因可能是即使您更早触发 js 标记。 It can not guarantee the second tag will wail the js loading finished by the first tag.
它不能保证第二个标签会在第一个标签完成的 js 加载时发出警告。
Tag 1 fired ----> Tag 2 fired ----> error触发标签 1 ----> 触发标签 2 ----> 错误
js start loading --------------> it might load finish in here js 开始加载 -------------- > 它可能会在这里加载完成
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.