CalderaWP / cf-google-analytics

Google Analytics events, eCommerce Tracking and AdWords conversion tracking
https://calderaforms.com/downloads/caldera-forms-google-analytics-tracking/
0 stars 1 forks source link

AdWords Conversion Tracking #3

Open Shelob9 opened 7 years ago

Shelob9 commented 7 years ago

This doesn't exist

Need to:

lchski commented 7 years ago

Shelving this for now, here are research notes for future development:

There are two broad methods to implement this: via JS, or via PHP.

JS

An example JS snippet, with the function-based approach for submitting conversions:

<!-- Google Code for Caldera Testing Conversion Page
In your html page, add the snippet and call
goog_report_conversion when someone clicks on the
chosen link or button. -->
<script type="text/javascript">
  /* <![CDATA[ */
  goog_snippet_vars = function() {
    var w = window;
    w.google_conversion_id = 921199832;
    w.google_conversion_label = "3_tqCJSm6W0Q2MmhtwM";
    w.google_conversion_value = 10.00;
    w.google_conversion_currency = "CAD";
    w.google_remarketing_only = false;
  }
  // DO NOT CHANGE THE CODE BELOW.
  goog_report_conversion = function(url) {
    goog_snippet_vars();
    window.google_conversion_format = "3";
    var opt = new Object();
    opt.onload_callback = function() {
    if (typeof(url) != 'undefined') {
      window.location = url;
    }
  }
  var conv_handler = window['google_trackConversion'];
  if (typeof(conv_handler) == 'function') {
    conv_handler(opt);
  }
}
/* ]]> */
</script>
<script type="text/javascript"
  src="//www.googleadservices.com/pagead/conversion_async.js">
</script>

PHP

General