Skip to content

Commit

Permalink
[TASK][PRS-370] add pageUri to Hubspot Form Submission
Browse files Browse the repository at this point in the history
  • Loading branch information
Elizabeth Dunphy committed Jun 15, 2020
1 parent e80cfa7 commit f1fc326
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Form/Finisher/HubSpotFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ protected function executeInternal()

$hubspotFormData = $this->populateHubspotFormData($formRuntime);
$hubspotFormData['hs_context'] = json_encode($this->buildHubspotContext($formRuntime));

$hubspotFormId = $formRuntime->getFormDefinition()->getIdentifier();
$formSubmitResponse = $this->hubspotFormService->submit($hubspotFormId, $hubspotFormData);

Expand Down Expand Up @@ -71,9 +70,10 @@ protected function buildHubspotContext(FormRuntime $formRuntime): array
$httpRequest = $formRuntime->getRequest()->getHttpRequest();
$hubspotContext = [
'ipAddress' => $httpRequest->getClientIpAddress(),
'pageUrl' => $httpRequest->getUri(),
'pageUrl' => $httpRequest->getServerParams()['HTTP_REFERER'] ?? '',
'pageName' => $formRuntime->getFormState()->getFormValue('page') ?? '',
];

if ($httpRequest->hasCookie('hubspotutk')) {
$hubspotContext['hutk'] = $httpRequest->getCookie('hubspotutk');
}
Expand Down

0 comments on commit f1fc326

Please sign in to comment.