Adding Transaction-Specific Conversion Tracking from Adwords into WooCommerce

As the developer of the WooCommerce AdWords Conversion Tracking plugin I can give you a few answers to your questions plus some reasons to use a plugin or ours in particular.

Answers to your questions:

  1. Your function probably will be impaired or not working at all. The reason is, that WordPress filters out the CDATA tags automatically (everything within the content part that is between <body></body>). And you can’t do anything about it. The filter can’t be turned off. It is a bug that has been reported long time ago: http://core.trac.wordpress.org/ticket/3670
    There is an experimental workaround, but it likely will not work
    with all themes.

  2. In theory yes. But Googles instruction is more of a recommendation. The tag will work regardless. If you put it in the header, or footer or directly after the tag, it doesn’t really matter. And it is a quite difficult task to position it so exactly using WordPress if you don’t want to edit your theme template files.

  3. Yes. You are missing: Deduplication, suppression of tracking for failed payments, tax and shipment exclusion, avoid tracking of admins and shop managers to start with.

Deduplication: If the visitor reloads the thankyou page for whatever reason, the order will be tracked twice (or even more times).

Failed payments: If a payment fails the thankyou page will still be triggered and thus your tracking code.

Tax and shipment: Generally you don’t want to track shipment and tax, just the product price. To get the value without tax and shipment you’ll have to use get_subtotal().

In our plugin we have solutions for all issues mentioned above. And we are working on even more interesting functions.

In general plugins can be a good thing if they go beyond just including simple functions, use best practices to avoid performance drag and keep the installations safe.