From d8c00fa4f729de52e9f45e878d2754691159c9a6 Mon Sep 17 00:00:00 2001 From: Josh Allen Date: Sun, 17 Mar 2019 02:57:40 -0400 Subject: [PATCH] Send Page Title to HubSpot instead of Form Title Since the form is linked to HubSpot already, the notifications sent from HubSpot already explain what form was filled out. So sending the GravityForms form title doesn't make much sense/explain more. It makes more sense to get the current page title that's submitting the form, so that way when the notification gets sent from HubSpot, it accurately shows what page the person submitted the form on. --- src/Base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base.php b/src/Base.php index fcd57e2..5b01dff 100644 --- a/src/Base.php +++ b/src/Base.php @@ -207,7 +207,7 @@ protected function getHubSpotContextCookie($form, $feed) { 'hutk' => $hubspotutk, 'ipAddress' => $ip_addr, 'pageUrl' => apply_filters( 'gf_hubspot_context_url', site_url(strtok($_SERVER['REQUEST_URI'], '?')) ), - 'pageName' => apply_filters( 'gf_hubspot_context_name', $this->getValue($form, 'title') ), + 'pageName' => apply_filters( 'gf_hubspot_context_name', get_the_title() ), ); if ( $this->getValue($feed, 'meta/disableCookie') == 1 ) { unset($hs_context['hutk']);