PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Tracking with Google Analytics

  1. Apologies if this is indeed a duplicate post, but the last thing I saw about this was in this thread which is 10 months old. ( http://www.gravityhelp.com/forums/topic/onclick-tracking ) Trying to setup goal tracking and would prefer to not have to redirect to a thank you page... as I am loading the form into a modal window. Is this still the best way to do this? Since I am doing it in a modal window, I guess the window would be the only thing that would redirect -- are the benefits to doing it that way superior?

    Posted 12 years ago on Monday October 22, 2012 | Permalink
  2. Also found this ( http://www.gravityhelp.com/forums/topic/onclick-event-tracking-for-submit-without-editing-plugin-code ), but I'm still not having any luck. The kept the confirmation code from the original. Went to the version that uses the title and does not rely on matching ( or not matching ) the formID. The confirmation message displays, but I don't see the goal showing up in GA.

    Posted 12 years ago on Wednesday October 24, 2012 | Permalink
  3. Scott, in this topic http://www.gravityhelp.com/forums/topic/onclick-tracking it did not seem to me that a thank you page was required. David's code here was using the gform_post_submission hook (now you should use the gform_after_submission hook). Did you try this and what was your result?

    Posted 12 years ago on Thursday October 25, 2012 | Permalink
  4. Correct, I am not using a thank you page. I did try this as well as the modified code that takes out the check from the formID so it does it for all forms and passes the form title. The confirmation message in David's example displays when I submit the form, but nothing shows up in GA as registering the event/goal.

    Posted 12 years ago on Thursday October 25, 2012 | Permalink
  5. Sounds like it's just a configuration issue then, since the code appears to be working (i.e. you are seeing David's message.)

    Is the GA code already present in your modal? His code just pushes an event to GA. The analytics code needs to be present already. Can you share a link to the page with the form where we can submit it ourselves? Thanks.

    Posted 12 years ago on Thursday October 25, 2012 | Permalink
  6. Chris, well... egg all over my face. When you specifically mentioned the modal, and was the code there, it dinged. I confirmed. Because I am loading the form into a modal window, I am using a stripped down version of the theme, that is not calling the header of the theme which is where the GA code was being loaded. I hard coded the GA script into the modal window page theme and lights and sirens are going off! Thank you. Sorry to took me thick skull a while to pick that up. Hopefully my mistake will help others.

    Posted 12 years ago on Thursday October 25, 2012 | Permalink
  7. Perhaps I spoke too soon. It appears to only be working on one of the forms and not all.

    Obviously something on my end with config. Not sure what though. There are 3 forms on that page, that open into a modal. Request showing, request info, and share. Request showing is only one that appears to be working.

    Edit to add -- I think it is related to Ajax. The other forms had Ajax enabled, and they weren't triggering the confirmation message. Took Ajax off, and confirmation message appeared again.

    http://www.louisvillecondosandlofts.com/mls/8535-grand-neptune-dr-louisville-ky-40228-mls-1337730

    Posted 12 years ago on Thursday October 25, 2012 | Permalink