Tracking links on the thank you page for form wizard

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
8/28/2013 4:56:00 PM
Gravatar
Total Posts 21

Tracking links on the thank you page for form wizard

Hi,

I've got Form Wizard Pro on my site.  I'm using it to request some info from my users prior to letting them download our software.  The thank you page consists of a set of links to the various downloads for our products.

I'm trying to add a script to the thank you page which attaches google analytics events to the links.  This lets us see which products were downloaded from that page in our analytics account.

For example, within the html of the thank you message, I have a script like the following:

<script>

  $(document).ready(function () {

    $(".my-product a").click(function () {

      _gaq.push(['_trackEvent', 'file', 'zip', 'my product']);

  });

  });

</script>

I've used this approach on other pages within mojoportal with success.  However, the google analytics chrome debugger tool shows me that when the thank you page is displayed, the above javascript isn't executed and nothing happens when I click a download link.

My guess is this has to do with the fact that the formwizard appears to use some form of ajax to load the thank you page html, rather than actually load a new page.  Since I figured the $(document).ready() callback may not be executed in that case, I tried the same code just without the $(document).ready(), but no dice.

Is there a way I could get this javascript to work on the thank you page?

8/29/2013 10:51:59 AM
Gravatar
Total Posts 18439

Re: Tracking links on the thank you page for form wizard

Hi,

Instead of wiring up the tracking after the fact, try just put the tracking right in the onclick on the download link similar to the scenario for outbound link click tracking.

Hope that helps,

Joe

8/29/2013 11:07:50 AM
Gravatar
Total Posts 21

Re: Tracking links on the thank you page for form wizard

Sorry I missed that in the docs, thanks, works great!

You must sign in to post in the forums. This thread is closed to new posts.