Re: Data Layer implementation on Marketo forms

Yavor_Todorov
Level 2

Data Layer implementation on Marketo forms

Hello,

 

we are trying to leverage the Data Layer that is being generated for the forms through Marketo. We want to collect the form ID, form name(in our case this is the Program name, captured via token in the form) and the event type.

 

I have this demo page https://info.softwareag.com/tracking-events.html and this JS that should control the implementation: https://info.softwareag.com/rs/858-DJP-749/images/tracking_events.js 

 

The problem is that on form.onSuccess(or form.onSubmit) the eventType stays as "formLoad". But in fact it should change to "formSubmit".

 

Do you have an idea how to fix this?

 

Kind regards,

Yavor

1 REPLY 1
WolframLotz
Level 3

Re: Data Layer implementation on Marketo forms

Hi Yavor, 

looks like you created an arrey of events but you ask for the eventTyp of 0 only. 

console.log(digitalData.events[0].eventInfo.eventType);

output "FormLoad"

 

console.log(digitalData.events[1].eventInfo.eventType);

output is "formSubmit"

did you check which data you receive?