Twitter Card integration with Google Tag Manager


#1

Hi, i have a problem with Google Tag Manager with my Twitter card…

1/ if i am using without Google Tag Manager, it works fine:
https://www.RocheVendorSecureInfo.com/testgtm_normal.html , which contain:

<meta name=“twitter:card” content=“summary_large_image”>
<meta name=“twitter:site” content="@rochecanada">
<meta name=“twitter:creator” content="@rochecanada">
<meta name=“twitter:title” content=“It’s not just business, it’s personal”>
<meta name=“twitter:description” content=“What our purpose statement – Doing now what patients need next – means to us”>
<meta name=“twitter:image” content=“http://graphics8.nytimes.com/images/2012/02/19/us/19whitney-span/19whitney-span-articleLarge.jpg”>

2/ if i am using Google Tag Manager, that include the “Custom HTML” with the meta-tags above using:
https://www.RocheVendorSecureInfo.com/testgtm.html, the validator couldn’t recognize it:

INFO: Page fetched successfully
INFO: 2 metatags were found
WARN: Not whitelisted

please advise


#2

(moved to the correct category for Cards questions)

As far as I’ve understood things from previous questions here on the forums, GTM relies on using Javascript to inject the tags into a page on browser load. Twitter’s crawler cannot execute any Javascript, and requires that your tags be added to the page in a static context, so this will not work.

I am not aware of a workaround for Twitter Card markup to work with GTM.


#3

thanks Andy…

However i notice the following roche.com site make the Twitter card works with GTM:
http://www.roche.com/media/store/roche_stories/roche-stories-2017-03-08.htm?utm_source=T&utm_medium=E&utm_campaign=IWD2017

the card validator validates the twitter card using the above link and if you look at the HTML source code of the above link, it’s using GTM, can you please investigate? thanks


#4

I’m unable to look into how a specific site is able to do that. You’d need to ask the site owners.