APIs & Integrations

joaomag
Member

HTTP Referer

Hi! 

I would like to know how to send the http referrer from a hubspot landing page to an external website, in order to be available on the other PHP website on the 

 

$_SERVER['HTTP_REFERER']

 

 

For context, we're building a landing page that will direct users to an external website (inside our own codebase), but we need to ensure that users are actually coming from the hubspot landing page, so we were thinking of using the HTTP referrer but it shows up blank.

 

Thanks for any help.

0 Upvotes
2 Replies 2
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

HTTP Referer

Hi @joaomag ,


What is the reason you need to ensure that a visitor came from the HS landing page?

If it is for something simple, like displaying content etc. I would personally go for something more simple like passing an URL parameter, similar to `utm_referrer`, so the links could look something like this;

https://mynothubspotwebsite.com/page?referrer=hubspot



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.


0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

HTTP Referer

Hey, @joaomag 👋 Thanks for your question.

 

Using the Referer HTTP request header presents some challenges. Including:

  • This header is dependent on the client's web browser.
  • Which can cause it not always be sent
  • some browsers and browser extensions can block or modify this header for privacy reasons
  • It's not accessible over HTTPS

 

For additional context, have a look at this Stack Overflow thread — How to use $_SERVER['HTTP_REFERER'] correctly in PHP? 

 

Hey @stefen @skimura @Teun, do you have any feedback or suggestions for @joaomag?

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes