本文介绍了带有两个提交按钮的GTM和asp.net网络表单的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Google跟踪代码管理器(GTM)和表单标签中的两个提交按钮(常见的传统asp.net Webforms技术)时,只想共享一个发现.

Just wanted to share a discovery when using Google Tag Manager (GTM) and two submit buttons in a form-tag (common legacy asp.net Webforms tech).

GTM由网站编辑使用.因此,当需要实现或跟踪其他脚本或事件时,开发人员无需参与.

GTM is used by website editors. So the developers doesnt need to be involved when other scripts or event needs to be implemented or traced.

问题在于,GTM中的某些内容使我们的表单始终触发默认的提交按钮(默认顺序是第一个).

The problem is that something in GTM is making our form to always trigger the default submit button (the first in order is default).

示例问题/如何复制:在向导场景中,带有返回和下一个提交按钮,它们会触发回发.单击下一步将触发后退按钮.

Example problem/how to reproduce: in a wizard scenario, with back and next submit buttons, which are triggering a postback. Click on next is triggering the back button.

删除GTM代码,它可以工作.

Removing the GTM code, and it works.

这是旧版网站.也许是一个遗留问题,但是该网站一直有效,直到我们实施了GTM.

This is a legacy site. Maybe a legacy issue, but the site worked until we implemented GTM.

您现在可以问我,我们在GTM中使用了哪些组件.好的,谷歌分析是其中之一,那我不知道.

You may ask me now, what components are we using in GTM. Well google analytics is one, then i don't know.

致谢.

推荐答案

解决方法:我不得不重新构建HTML,以免使用"input type = submit".而是使用没有提交行为的按钮.例如,不要在其中一个按钮上使用回发".

Work-around solution: I had to rebuild the HTML to NOT use "input type=submit".Instead use buttons without submit behavior. eg not use "postbacks" on one of the buttons.

可能是GTM小组可以查看或告知的内容.

Probably something for the GTM team to look at or inform.

这篇关于带有两个提交按钮的GTM和asp.net网络表单的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 07:21