Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

SanfordWhiteman
Level 10 - Community Moderator

Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

What would be a less-questionable place to allow inserting a codeblock?

I never want template consumers (LP content authors/marketers) to be in control of how page activities are tracked. They might control whether page activities are tracked or not using a mktoBoolean variable, but I see only disasters when freeform code is encouraged at the LP level.

Though it's impossible to technically stop LP authors from adding code that breaks other code (even if just the HEAD accepts HTML, that's enough to break stuff) I don't want to make it an accepted option.  Even if only developers are adding and modifying code blocks (based on the honor system?) how do you efficently fix bugs -- like the bug I noted is in your code now -- when you have the code pasted separately into a bunch of LPs?

Anonymous
Not applicable

Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

That "allowHtml" is exactly what I was looking for. I knew there must be some kind of easy setting to prevent this behavior.

Anonymous
Not applicable

Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

Hello,

My landing page is built in with a guided landing page template.

My issue is How & Where to insert Event tracking code ?

SanfordWhiteman
Level 10 - Community Moderator

Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

You can insert it into the template (which in many cases is where you want it, rather than having to add it manually to all derived LPs).

You can use a Text or Rich Text {{my.token}}. You can use a snippet.

What you can't do -- without causing an unnecessary technical burden -- is use a mktoText variable, because these variables are HTML-encoded upon output. This is similar to the default behavior of custom text fields at the Lead level.

Bottom line: in some contexts, "text" really means "text for output," which means HTML encoding is necessary.

Anonymous
Not applicable

Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

Thanks that answered my question. So I can use a Program Token to insert code.

Looking closely at Gyan's question I don't think that's the issue there, I think it probably that has more to do with Google Event Tracking. Sorry for the distraction.

SanfordWhiteman
Level 10 - Community Moderator

Re: How to insert Google Analytic Event tracking code in a Guided Marketo Landing Page?

Gyan Contact​ please link to a live URL. I can tell you straight away that your code is broken because you aren't using the GA hitCallback option: in production, you'll lose huge swaths of data. Nevertheless you be able to gather some data, not none, provided you test using late-model Firefox or Chrome.