Gmail Schema Tags | Community
Skip to main content
Jun 19, 2014 10:48 PM UTC
Solved

Gmail Schema Tags

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.
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Justin_Cooperm2
Justin_Cooperm2Accepted solution
Level 10
Jun 23, 2014 5:33 PM UTC
It's not stripping it when I do that.

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

10 replies

Level 9
Nov 4, 2018 12:56 AM UTC

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!

Translate
Jun 23, 2014 6:37 PM UTC
My mistake. It's there. Thank for checking on that.
Translate
Justin_Cooperm2
Justin_Cooperm2Accepted solution
Level 10
Jun 23, 2014 5:33 PM UTC
It's not stripping it when I do that.

When you click "Show original" in gmail, you don't see the script present?
Translate
Yoav_Guttman1
Level 4
Jun 22, 2018 7:46 PM UTC

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

Translate
Justin_Cooperm2
Level 10
Jun 22, 2018 8:26 PM UTC

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

Translate
Jun 20, 2014 6:54 PM UTC
Tried this when it first came out with no luck. Not sure if Marketo is working on this or not.
Translate
Jun 20, 2014 3:18 PM UTC
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.
Translate
Justin_Cooperm2
Level 10
Jun 19, 2014 11:46 PM UTC
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...
Translate
Jun 19, 2014 11:08 PM UTC
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.
Translate
Justin_Cooperm2
Level 10
Jun 19, 2014 10:59 PM UTC
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
Translate