Highlighted

JSON-LD to manage contact points

Silver Contributor
Silver Contributor

How best can I leverage TiQ to manage my contactpoints so that I can inject the following into our pages.

<script type="application/ld+json">
{
 
"@context" : "http://schema.org",
 
"@type" : "Organization",
 
"url" : "http://www.your-company-site.com",
 
"contactPoint" : [{
   
"@type" : "ContactPoint",
   
"telephone" : "+1-401-555-1212",
   
"contactType" : "customer service"
 
}]
}
</script>

Can i just add a javascript extension if so how can I specify ld+json?  Could I just add a new container tag and just toss this into the tag template?

 

8 REPLIES 8
Highlighted

JSON-LD to manage contact points

Tealium Employee

Hi Joseph,

 

I think this might be what you're after: https://community.tealiumiq.com/t5/2-Tealium-iQ-Documentation/Tealium-SEO-JSON-LD-Tag-Basic-Configur...

 

Not all the properties you want to use are supported yet in the default tag template, but it would give you a good starting point to edit the template and see how we're doing it. You could either add new properties using a JavaScript extension as the document suggests, or edit the tag template to add the additional parameters.

 

If you need any assistance, let me know.

 

Craig.

Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Highlighted

JSON-LD to manage contact points

Silver Contributor
Silver Contributor

Hi Craig,

 

So I revied the documentation and it does not really specify how to use the JavaScript extension to add additional properties.  I am guessing I can just scope it to that tag and paste the following into the extension. 

{
"@context" : "http://schema.org",
"@type" : "Organization",
"url" : "https://www.lfg.com",
"contactPoint" : [{
"@type" : "ContactPoint",
"telephone" : "+1-877-275-5462",
"contactType" : "customer service",
"contactOption" : "TollFree",
"areaServed" : "US"
}]
}

 

Also when I attempt to test the basic tag configuration using https://developers.google.com/structured-data/testing-tool/.  The basic tag configurations do not seem to be coming through for Website or Breadcrumb.

Highlighted

JSON-LD to manage contact points

Tealium Employee

I just tried the following, and it injected the script as expected:

 

1. Add a new JS Code extension scoped to the "Tealium SEO" tag

 

2. Add the following code:

u.injectJSONLD([{
"@context" : "http://schema.org",
"@type" : "Organization",
"url" : "https://www.lfg.com",
"contactPoint" : [{
"@type" : "ContactPoint",
"telephone" : "+1-877-275-5462",
"contactType" : "customer service",
"contactOption" : "TollFree",
"areaServed" : "US"
}]
}]);

 

NOTE: the function is expecting an array of objects, so you need to add extra square brackets around your JSON object.

 

The Google validator tool does seem to struggle to pick up JSON-LD that's injected through JavaScript, although to the best of my knowledge, it does work fine despite this (although it will take a while for Google to crawl your site and make use of the new data - in some cases up to several weeks).

Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Highlighted

JSON-LD to manage contact points

Rookie Contributor

@craig_rouse - has there been any additional progress on getting Google's SDTT to pick up these tags? Is this still a known issue or is there some additional documentation out there to help resolve?

 

thanks!

Highlighted

JSON-LD to manage contact points

Tealium Employee
@hpbrad this is still a known issue. The problem is that the testing tool does not appear to evaluate JavaScript when it grabs the page source, and therefore does not see the JSON-LD tags that have been added by JavaScript (Tealium iQ).

The Google web spiders/crawlers do, however, execute JS, and will be able to see the markup. We have validated that this works correctly on multiple deployments of the tag.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Highlighted

JSON-LD to manage contact points

Rookie Contributor

Thanks for the update @craig_rouse ... are you guys discussing this with google, or is there any planned adjustments to the implementation on either side to address that? 

 

It definitely makes troubleshooting the actual content a bit more difficult. Any tools you guys can recommend that DO execute JS that would allow me to get a similar understanding of whether things are implemented properly? 

Highlighted

JSON-LD to manage contact points

Tealium Employee
@hpbrad we aren't actively discussing this with Google. Since JSON-LD is Google's own spec, I'm not aware of any 3rd party tools that will do the validation. They do have an option to paste a code snippet, so you could paste your JSON object into the code snippet box on the testing tool, and it should then validate that the script is correct and highlight any errors.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.
Highlighted

JSON-LD to manage contact points

Silver Contributor
Silver Contributor

Hi @craig_rouse,

I am having same issue. Want to load static javascript code on all pages of the website. As advised I created js extension, put the code in there, created new Tealium SEO(JSON-LD) tag and ext scoped to the new tag. 

I do see the static code on all the pages. But there is also a breadcrumb list tag that gets fired from Tealium SEO(JSON-LD) tag which I don't want. Is there any way to avoid the breadcrumb list that takes from url.