简体   繁体   中英

Conversion tracking for Google AdWords that works with a form's submit button

I want to put the tracking code on my website but the instructions on Google's Instructions tells you how to do it by a normal link. I have my form set up with the post method that goes to a php include that emails the form results and then it goes to an thank you page. How do I set it up for the submit button/form to properly work?

You actually use a javascript onClick function, which is added to your form's submit button.

If you scroll down a bit on the link that you posted ( https://support.google.com/adwords/answer/6095821 ) you should see the section titled "Tracking clicks on links or buttons as conversions". Look for and click "Setting up an onclick handler for conversions" and you will see the instructions.

Nowadays there is a built-in way for AdWords to do async tag firing. It is described in this article.

In brief you would need to change setting in AdWords it would generate you async tag, which you load with the DOM, and activate with onClick handler.


Example:

<a onclick="goog_report_conversion ('http://example.com/your-link')"
href="http://example.com/your-link">Download now!</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM