How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

Highlighted
Level 2

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

Would this be better than say using {{Page URL}} as the label in the GTM/GA tag for the event?

Highlighted
Level 10 - Community Moderator

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

A built-in token is fine, too, I just like to have direct control.

Highlighted
Level 2

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

Ok. So if I go the route of adding through a push I need one more line of code such as:

 

"marketo.form_url": document.location.href

 

Highlighted
Level 10 - Community Moderator

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

Yep!

Highlighted
Level 2

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

Excellent! Thanks.

 

Pardon this non-programmer question but is there any significance to the naming convention? For example could:

marketo.form_id

 be simply

form_id
Highlighted
Level 10 - Community Moderator

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

It's just a convention to create a namespace-like/hierarchy-like/object-like feel.  You don't have to use it.

 

In other words, it simulates a complex object like:

{
  "marketo" : {
     "form_id" : 123
  }
}

 

But it isn't really like that under the hood, it's just flat.

Highlighted
Level 2

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

When it comes to implementing tracking in Google Tag Manager (GTM) what is the process?

Highlighted
Level 10 - Community Moderator

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)


When it comes to implementing tracking in Google Tag Manager (GTM) what is the process?

Well... what are your goals? GTM + Data Layer seems like something you're already using.

Highlighted
Level 2

Re: How to track Marketo forms in Google Analytics using using API and Google Tag Manager (GTM)

Sorry for the delay. The goal would be to track successful form submissions in Google Analytics