HubSpot Ideas

baribeau

HubL/Hubspot should always pass window.top.location as a variable when it injects an iframe

CORS restrictions (?) mean that the variable {{ request.referrer }} doesn't return the full page path — it gives something like "https://website.com" instead.

 

When Hubspot injects an iframe (for example, in the CTA Beta), it would be useful to be able to access the URL of the parent frame from within the iframe itself. 

 

For example, each of the below variables return the URL of the iframe content itself (like "http://1234567.hs-sites.com/hs-web-interactive-1231234-123451234510"), instead of returning the location of the page where the iframe was embedded (like "https://website.com/some-great-blog-post") :

  • {{ content.absolute_url }}
  • {{ page_meta.canonical_url }}
  • {{ request.full_url }}
  • {{ request }}
  • {{ content.url }}
  • {{base_tag_href}}

I want to be able to add something like {{request.referrer.fullpath}} as a variable (in an email, a CTA, etc.), and get a useful result.

1 Reply
baribeau
Contributor

For my direct purposes, this would no longer be necessary if Hubspot stopped serving content in iframes. One example of an idea ticket in support of that is this one: https://community.hubspot.com/t5/HubSpot-Ideas/Allow-loading-new-CTAs-Beta-outside-of-iframe/idi-p/8...