Wrapping Hubspot landing page wordpress


We are trying to use smart content blocks in our website (we want to show different content based on a hubspot persona). We have this page try.surveygizmo.com/dashboard/ (hosted on hubspot). Smart content works here (screencast.com/t/p6GtaT2W9). But when we wrap the page in wordpress (www.surveygizmo.com/dashboard/) using this:

function get_web_page( $url ) {
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don’t return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => “”, // handle all encodings
CURLOPT_USERAGENT => “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)”, // who am i
CURLOPT_AUTOREFERER => false, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects

$ch      = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err     = curl_errno( $ch );
$errmsg  = curl_error( $ch );
$curl_info  = curl_getinfo( $ch );
curl_close( $ch );

$curl_info['errno']   = $err;
$curl_info['errmsg']  = $errmsg;
$curl_info['content'] = $content;

return $curl_info;


the page shows default content:

Can someone explain why this is happening?


@hoodenkiy smart content on the HubSpot COS works based off of the hubspotutk cookie of the visitor, and whether or not that cookie is tied to a contact record. In order for the smart content to show up, you’d need to pass the cookie of the visitor hitting your Wordpress site through to the request you’re making to HubSpot, effectively proxying the request to HubSpot for the visitor.

If you’re looking to create smart content on an external site, you can get the contact data for the visitor based on that cookie through the Contacts API, and then use that contact data to determine what your site shows to the visitor.


Could you provide an example how would this look: “pass the cookie of the visitor hitting your Wordpress site”?

So from hat I understand, correct me if I’m wrong, this is what needs to happen:
A visitor hits app.surveygizmo.com
in turn surveygizmo.com checkks for a hubspot coockie & sends it wordpress
so when wordpress requests the page from hubspot the cookie is there


Thank you