Issue with Submitting marketo forms with events in GA

SanfordWhiteman
Level 10 - Community Moderator

Re: Issue with Submitting marketo forms with events in GA

And btw this is what it looks like when you correctly start a ga('send') ​but do not correctly control for the gaping race condition with ​hitCallback:

2016-11-10 02_40_45-MktoForms2 __ GA w_Race Condition - Slimjet.png

SanfordWhiteman
Level 10 - Community Moderator

Re: Issue with Submitting marketo forms with events in GA

OK, I kept looking into this. The problem with your GA setup is that you have two auto-named GA trackers. Neither is the default so ga('send'...) will not work.  Only ga('{tracker_name_here}.send') can be used. Make sure you hard-code understandable names for each, then you can use ga('friendly.send',...). 

The form events are being handled correctly, so this is not a Marketo-related problem.

Manish_Khemani1
Level 3

Re: Issue with Submitting marketo forms with events in GA

Hi Stan,

Thanks for Your Observation; Appreciate Your Efforts in Helping Me Out J.

We have configured 2 tags for GA - Pageview (shown in the screen shot) and

we tried using the tracker name in the form.Onsuccess code - which now is

as follows, But Yet The Event does Not Fire.

SanfordWhiteman
Level 10 - Community Moderator

Re: Issue with Submitting marketo forms with events in GA

Hi Stan,

Sanford or Sandy please, not Stan.

We have configured 2 tags for GA - Pageview (shown in the screen shot) and

we tried using the tracker name in the form.Onsuccess code - which now is

as follows, But Yet The Event does Not Fire.

I don't see a screenshot attached. I do see that you've now broken the onSuccess with a JS syntax layer.

You shouldn't be testing in onSuccess because the form is not involved and this will just create more steps to go through when testing. This is a pure GA issue.

When you say you're using the "tracker name" I doubt you are doing this correctly.  You're using auto-naming, which means every time the page draws there's a new name.  For example, this will work once, but never again:

     ga('gtm1478804647856.send', {

          hitType: 'event',

          eventCategory: 'Fills out Form',

          eventAction: 'Downloads Content',

          eventLabel: 'Guide',

    });

Manish_Khemani1
Level 3

Re: Issue with Submitting marketo forms with events in GA

Also Stan,

If I Need to fire a GA Event for a Known User - Will the form.onSuccess

handler work or is there some other code that needs to be written?

Thanks Again!

With Best Regards

Manish Khemani

Tata Consultancy Services

Mailto: manish.khemani@tcs.com

Website: http://www.tcs.com

SanfordWhiteman
Level 10 - Community Moderator

Re: Issue with Submitting marketo forms with events in GA

If I Need to fire a GA Event for a Known User - Will the form.onSuccess

handler work or is there some other code that needs to be written?

If you're using the Known Lead HTML feature and somebody clicks the Download button, that will fire ​onSuccess.