SevenShores\Hubspot\Resources\Events::trigger PHP Метод

trigger() публичный Метод

This only works for enterprise accounts.
public trigger ( string $hubId, string $eventId, string $contactEmail = null, float $contactRevenue = null, array $contactProperties = [] ) : Response
$hubId string Your HubSpot portal ID ("Hub ID"). You can find your Hub ID in the footer of the HubSpot UI, or in the URL. For example, in this URL: "https://app.hubspot.com/reports/56043/events/" your Hub ID is "56043".
$eventId string
$contactEmail string Optional - contact email.
$contactRevenue float Optional - the monetary value this event means to you.
$contactProperties array Optional - array of new contact properties.
Результат SevenShores\Hubspot\Http\Response
    function trigger($hubId, $eventId, $contactEmail = null, $contactRevenue = null, $contactProperties = [])
    {
        $endpoint = sprintf("http://track.hubspot.com/v1/event?_a=%s&_n=%s", url_encode($hubId), url_encode($eventId));
        $contactProperties['email'] = $contactEmail;
        $contactProperties['_m'] = $contactRevenue;
        $query_string = build_query_string($contactProperties);
        return $this->client->request('get', $endpoint, [], $query_string);
    }
Events