SOLVED

Gmail Schema Tags

Go to solution
Anonymous
Not applicable
Has anyone had any luck adding the new Gmail schema code (https://developers.google.com/gmail/actions/reference/offer) to emails. It seems the code is getting stripped because it does not validate.

Cheers.
Tags (1)
1 ACCEPTED SOLUTION
Justin_Cooperm2
Level 10
It's not stripping it when I do that.

When you click "Show original" in gmail, you don't see the script present?

View solution in original post

10 REPLIES 10
Phillip_Wild
Level 10

Hi everyone

I tried to add this code to our double opt in confirmation email:

<script type="application/ld+json">

{

  "@context": "schema.org",

  "@type": "EmailMessage",

  "potentialAction": {

    "@type": "ViewAction",

    "url": "(redacted)",

    "name": "Confirm subscription"

  },

  "description": "Confirm your subscription to G Adventures. Without this confirmation, you won't be subscribed to our email newsletter."

}

</script>

I placed it just before the </body> tag as per this article: How to Use Gmail Actions in Your Email Program | SendGrid . But when I tried to approve the email, I got the error "Marketo does not allow javascript or scripts in email" or something similar to that. Is there something I've missed in the thread above? Justin Cooperman​, any ideas?

Thanks!

Anonymous
Not applicable
My mistake. It's there. Thank for checking on that.
Justin_Cooperm2
Level 10
It's not stripping it when I do that.

When you click "Show original" in gmail, you don't see the script present?
Yoav_Guttman1
Level 4

Justin Cooperman​ - is there any step-by-step guide you have come across to add Google schema.org to Marketo emails?

Justin_Cooperm2
Level 10

It should work fine if you just paste the script into an email template in Marketo or to an individual email. This thread was pre-Email 2.0 and it shouldn't be stripping much anymore.

Justin

Anonymous
Not applicable
Tried this when it first came out with no luck. Not sure if Marketo is working on this or not.
Anonymous
Not applicable
Good idea. I see it leaves the script in tact upon saving the email, which is progress. But it looks like the script gets stripped when it gets sent, which makes sense since scripts can create security holes. I tried using the Microdata fromat which relies on div and link tags rather than script, but it looks like those are getting stripped too. I suspect the validator is at work there but I can't prove that. 🙂

Cheers.
Justin_Cooperm2
Level 10
Did you paste the script in via Email Actions > HTML Tools > Replace HTML?

Seems to not strip it out when I test it that way...
Anonymous
Not applicable
Hi Justin, Thanks for the reply. Yes, we're all set with Google. If we send a test outside of Marketo, the data is good. Our issue is that the code never makes it to Gmail when we send from Marketo because it's stripped altogether. Thanks.
Justin_Cooperm2
Level 10
Did you register with Google? Also looks like you'll need to have SPF/DKIM setup...

https://developers.google.com/gmail/actions/registering-with-google