Mobile app version of
Login or Join

 query : GA - Register a conversion without redirecting to the parameter used in the goog_report_conversion function I have a form which redirects to a third party site. My client wishes to register a


Posted in: #ClickTracking #GoogleAnalytics

I have a form which redirects to a third party site. My client wishes to register a conversion when this form is submitted.

I've used the click tracking script as described by Google here.

My form's submit button then has the following code:

<input type="submit" value="SUBMIT &gt;" onclick="goog_report_conversion('')" />

My assumption was that this would work the same as if someone had landed on, without actually going to that page, and thus my client could configure his GA to register hitting that URL as a conversion.

I assumed that didn't actually need to exist, but I created it as a blank page to be on the safe side.

However, when this onclick event is triggered, it redirects to rather than submitting the form (in Chrome, anyway).

The part of the tracking code causing this seems to be the following:

var opt = new Object();
opt.onload_callback = function() {
if (typeof(url) != 'undefined') {
window.location = url;

Is this because I have misunderstood what goog_report_conversion does, and as such should I be looking at a different way to report a click as a conversion? Or is there a configuration option in GA that says to redirect or not redirect to goog_report_conversion's parameter?

Thanks in advance.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155


Sorted by latest first Latest Oldest Best



Adding return false; should prevent the link in the onclick from being followed.

<input type="submit" value="SUBMIT &gt;" onclick="goog_report_conversion(''); return false;" />

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme