Trouble passing variables to iframe in CRM Card

I am working on developing a custom extension for a 3rd party partner that launches an iframe from a contact record that opens their software and connects the same contact record if it exists, or creates a new contact record in their system if it doesn’t.

Obviously, to make that happen I need to send the unique identifier, the customers email address, but to authenticate on the other system I also am sending the current Hubspot user’s userEmail that needs to match an admin user on to that system.

So, when I am setting the iframe action URI I am manually adding in the userEmail from $_GET and then adding the “associatedObjectProperties” to pass the contact ID and Email.

For some reason though Hubspot is not recognizing the first URL params I set in the URI so I can never get myself logged in, even though if I view source on the iframe all of my variables are there. If I copy and paste the iframe source into a new window the auto-login works perfectly. It is only in the Hubspot iframe popup that it does not work.
Here is my code defining my “primaryAction”:

	"primaryAction" => (object) array(
		"type" => "IFRAME",
		"width" => 1400,
		"height" => 1000,
		"uri" => "https://mydomain.com/hubspotIntegration?userEmail=".$_GET['userEmail'],
		"label" => "Launch iFrame",
		"associatedObjectProperties" => array( 
			'hs_object_id',
			'email',
		)
	)

Can anybody help me figure this out? Does Hubspot just ignore that first variable? Is what I am trying to do even possible?

Hey @darkhousedev ,

I think I have an idea for what you’re asking, but I’m not sure I’m 100% clear. Do you happen to have a live example that I can take a look at? An object record in a test portal would be ideal, but any record where I can jump in and take a look would do.

Thanks Derek,

It turns out the entire problem was that the source url for my iframe was caching my page hits, so it was receiving the URL parameters correctly, both the ones hardcoded in my URI and the ones passed as associatedContactProperties, but the cache was preventing it from showing me the correct result.

I have added a timestamp variable to the iframe src now as well to prevent future caching issues!

Hey @darkhousedev ,

Gotcha; thanks for coming back and positing your solution!