# Constructor

Learn how to initialize experiment metadata directly.

The constructor initializes the experiment metadata.

You normally read it from the [experience metadata](../experience-metadata/get-experiment) instead, but you can construct it directly to provide fixed metadata in tests.

## Signature

The constructor has the following signature:

```php
public function __construct(string $experimentId, string $variantId)
```

## Example

Here is a basic example of how to initialize experiment metadata:

```php
<?php
use Croct\Plug\Content\ExperimentMetadata;

$metadata = new ExperimentMetadata(
    experimentId: 'banner-color-test',
    variantId: 'blue',
);
```

## Parameters

The following list describes the supported parameters:

- `experimentId`: `string`

  The ID of the experiment running within the experience.

- `variantId`: `string`

  The ID of the variant assigned to the visitor.
