--- title: "Event" slug: "event-data-object-php-library-s2s" description: "Track events with the PHP library: event name, event parameters and goals via MappIntelligenceAction, with a code example." status: "update" updated: 2026-11-02T16:57:19Z published: 2026-11-02T16:57:19Z canonical: "docs.mapp.com/event-data-object-php-library-s2s" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Event Events track interactions on your website, such as clicks, scrolls, or other forms of content engagement. With the server-to-server libraries, your server sends the events, for example after a form submission or another action that your backend processes. JavaScript in the visitor’s browser is not required. --- ## Parameters Event parameters enrich event data with additional website-specific information or metrics. They must also be configured in Mapp Q3 before tracking. Find more information [here](/v1/docs/how-to-set-up-custom-parameters). When implementing, include the **ID number** and the **value** as a string. --- ## Goals Website goals measure the success of specific actions on your website. They allow you to analyze user behavior and attribute conversions to campaigns. Goals must be configured before they can be tracked via the library. Find more information [here](/v1/docs/how-to-define-website-goals). When configuring tracking, include the **goal ID** and the **value** as a string. Each goal is considered achieved as soon as a value is tracked, regardless of the actual content of that value. > [!NOTE] > Note > > The predefined goal Order cannot be tracked within the event object. > > Avoid submitting values like "no" for goals such as Newsletter Registration, as this would still mark the goal as achieved. --- **Supported Methods** | **Method** | **Description** | **Where to configure *** | **Where to analyze** | | --- | --- | --- | --- | | **constructor** | Defines the initial event request and can overwrite the default event naming. | – | *Navigation > Events* | | **setName** | Defines the unique identification of the event. | – | *Navigation > Events* | | **setParameter** | Tracks additional event-specific information or metrics. Follow the syntax guidelines when defining parameters. | EP > Own Configuration | *Navigation > Event Parameters > [Name of Parameter]* | | **setGoal** | Tracks website goals that are triggered by events (e.g. registrations or purchases). | EC > Own Configuration | Text: *E-Commerce > E-Commerce Parameters > [Name]* / Number: Metric | * **Configuration Path Abbreviations:** - **EP** = *Mapp Q3 > Configuration > Custom Parameters > Event Parameters > Preconfigured > …* - **EC** = *Mapp Q3 > Configuration > Custom Parameters > E-Commerce Parameters > Preconfigured > …* #### Generated request parameters | **Method** | **Request parameter** | **Constant** | | --- | --- | --- | | **constructor** / **setName** | `ct` | `ACTION_NAME` | | **setParameter** | `ck<ID>` | `CUSTOM_ACTION_PARAMETER` | | **setGoal** | `cb<ID>` | `CUSTOM_PRODUCT_PARAMETER` | > [!NOTE] > Note > > Values that are empty or exactly `0`, `0.0`, `false` or `{}` are not transmitted. For example, an event parameter or goal with the value `0` or `false` is not sent. To transmit such a value, send the request with a parameter map (see Request Parameters). **Methods** #### constructor ```php /** * MappIntelligenceAction constructor. * @param string $name */ $actionData = new MappIntelligenceAction($name); ``` Every request also contains a page name: the event is assigned to the page name of a `MappIntelligencePage` in the same `MappIntelligenceDataMap`, otherwise to the default page name (see [Page](/v1/docs/page-data-object-php-library-s2s)). #### setName ```php /** * @param string $name * @return $this */ $actionData->setName('foo.bar'); ``` #### setParameter ```php /** * @param int $id * @param string $value * @return $this */ $actionData->setParameter($id, $value); ``` #### setGoal ```php /** * @param int $id * @param string $value * @return $this */ $actionData->setGoal($id, $value); ``` Goals are sent as E-Commerce Parameters (`cb<ID>`). Event goals, page goals, order parameters and product parameters share these IDs: if several of them use the same ID in one request, only one value is sent. **Example** ```php $actionData = new MappIntelligenceAction(); $actionData    ->setName('foo.bar')    ->setParameter(2, 'param2')    ->setParameter(15, 'param15')    ->setGoal(2, 'goal2')    ->setGoal(15, 'goal15'); $mappIntelligence = MappIntelligence::getInstance(); $mappIntelligence->track((new MappIntelligenceDataMap())->action($actionData)); ```