Schema App Javascript in HubSpot


#1

I'm creating schema for my website using Schema App.

Schema App lets users automatically deploy schema generated in its editor to defined url's in multiple ways, one of which involves javascript generated with an API key unique to my Schema App account.

I've attempted to deploy the javascript on all my HubSpot pages by following HubSpot's instructions.

You can see on line 1530 of the home page, that the javascript deploys in the footer as follows:

//cdn2.hubspot.net/hub/1835920/hub_generated/template_assets/1546141089914/Custom/Javascript/SchemaApp.js

It should deploy as set out on lines 53-209, which I manually pasted into the header.

Unfortunately, Schema App has no instructional material that relates specifically to HubSpot. HubSpot Support has recommended that I raise my question in the Developers forum.

How do I get Schema App javascript to function in HubSpot?

Best Regards,

Bruce


#2

Sorry. My home page is. https://www.criminal-defense-law-nyc.com.


#3

Hi @Bruce, you are using script tag in a js file, which is a HTML tag.
Instead you can create a custom module of raw HTML field and include schema function file in it. Use that module in your template anywhere you want.


#4

Hi Dhiraj.

Thank you for answering my question.

Unfortunately, because I have no coding skills or knowledge, your answer is over my head.

Could you break down your answer a bit further for me?

Best,

Bruce


#6

Welcome, @Bruce!

Thanks for jumping in, @dhirajpandey.

Bruce, Dhiraj is saying that a formatting error is preventing the Schema App script from loading successfully. Since you included the JavaScript in a .js file, any browser will read it as JavaScript, so you don't need to put <script> and </script> around it.

I'm happy to help get the script placed correctly. Would you clarify the following?

  1. Could you share a link to Schema App's instructions (it doesn't have to mention HubSpot by name).
  2. What was the support ticket number? (I see that Hub ID 1835920 is associated with that site, but I can't find mention of any support tickets with that account.)
  3. Did you complete the final steps in this article? I don't see any scripts citing your SchemaApp.js file in account 1835920's settings.

#7

Thank you, Isaac!

Schema App was able to deploy the javascript by embedding the javascript directly into the sitewide footer, rather than embedding the "public URL" generated by HubSpot.

Best,

Bruce


#8

Glad to hear it, @Bruce!