Embedding in hubspot

Having trouble getting started? The viewer isn't loading properly?
lmvalenzuela
Posts: 4
Joined: Thu Apr 16, 2020 10:28 am
Contact:

Embedding in hubspot

Postby lmvalenzuela » Thu Apr 16, 2020 10:35 am

I'm trying to embed in a Hubspot html+hubl page, and just by adding the js files, I'm starting to get problems in the console:

Code: Select all

SyntaxError: missing : after property idimagerotator.min.js:1:622


I have control over head's files loaded by the page, and for now, the only files I've been downloading to the page are:
basic.css: https://cdn2.hubspot.net/hub/6860826/hu ... ic.min.css
jquery-3.4.1.min.min.js: https://cdn2.hubspot.net/hub/6860826/hu ... min.min.js
and

https://cdn2.hubspot.net/hub/6860826/hu ... tor.min.js

The code of the page:

Code: Select all

<!--
    templateType: page
    isAvailableForNewContent: true
-->
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{{ content.html_title }}</title>
    <meta name="description" content="{{ content.meta_description }}">
    {{ standard_header_includes |cut('https://static.hsappstatic.net/jquery-libs/static-1.1/jquery/jquery-1.7.1.js') }}
    <link type="text/css" rel="stylesheet" href="{{ get_asset_url('/TRUVAC_March2020 Theme/360/Prodigy/imagerotator/html/css/basic.css') }}"/>
    <script type="text/javascript" src="{{ get_asset_url('/TRUVAC_March2020 Theme/360/Prodigy/imagerotator/html/js/jquery-3.4.1.min.js') }}"></script>
    <script type="text/javascript" src="{{ get_asset_url('/TRUVAC_March2020 Theme/360/Prodigy/imagerotator/html/js/imagerotator.js') }}"></script>
  </head>
  <body>
   
    {{ standard_footer_includes |cut('https://static.hsappstatic.net/HubspotToolsMenu/static-1.62/js/index.js') }}
  </body>
</html>

WebSupport
Posts: 1034
Joined: Thu Aug 23, 2012 11:35 am
Location: Pasadena, CA
Contact:

Re: Embedding in hubspot

Postby WebSupport » Thu Apr 16, 2020 10:38 am

Any chance you could test without some get_asset_url which is may be causing it?

And also please remove jQuery 1.7.1 as you load another version (a good newer one) down below.

lmvalenzuela
Posts: 4
Joined: Thu Apr 16, 2020 10:28 am
Contact:

Re: Embedding in hubspot

Postby lmvalenzuela » Thu Apr 16, 2020 10:47 am

Jquery 1.7.1 is being removed the urls listed just below the code are the ones being resolved and loaded with a 200 status. The only 3 things that are now on the page are the ones being listed.
You can check on the console on the following link:

[link-removed]

WebSupport
Posts: 1034
Joined: Thu Aug 23, 2012 11:35 am
Location: Pasadena, CA
Contact:

Re: Embedding in hubspot

Postby WebSupport » Thu Apr 16, 2020 1:52 pm

Great! I think you are almost there. It currently can't find this image:

/hubfs/TRUVAC_March2020/360/Prodigy/images/Prodigy_360_11.19_Curb.jpg?t=1575918443


If I try to open it directly in my browser, it comes back with 404.

lmvalenzuela
Posts: 4
Joined: Thu Apr 16, 2020 10:28 am
Contact:

Re: Embedding in hubspot

Postby lmvalenzuela » Thu Apr 16, 2020 2:25 pm

It seems that hubspot is making some weird stuff when uploading to the CDN, so I put some of the files on other hosting. Seems working. I'll put the assets inside hubspot, but as you might guess there are a lot !

lmvalenzuela
Posts: 4
Joined: Thu Apr 16, 2020 10:28 am
Contact:

Re: Embedding in hubspot

Postby lmvalenzuela » Thu Apr 16, 2020 4:04 pm

Ok, here was what I had to do. To avoid CORS errors, all the assets are being stored inside hubspot.
Next thing, js, css and jquery have to live outside hubspot in order to work.
If someone has a similar problem, and has any doubts please, don't hesitate in contact me.

Thanks @WebSupport for the clues and the help !

WebSupport
Posts: 1034
Joined: Thu Aug 23, 2012 11:35 am
Location: Pasadena, CA
Contact:

Re: Embedding in hubspot

Postby WebSupport » Fri Apr 17, 2020 6:54 am

Interesting! Thanks so much for the update :)

PS: to avoid CORS errors for the 360 assets, you may also consider our optimized hosting that is configured to allow cross domain asset loading: https://www.webrotate360.com/services/pixriot.aspx


Return to “Setup Issues and Embedding”

cron