public function createImpressionEvent($config, $experimentKey, $variationKey, $userId, $attributes)
    {
        $eventParams = $this->getCommonParams($config, $userId, $attributes);

        $experiment = $config->getExperimentFromKey($experimentKey);
        $variation = $config->getVariationFromKey($experimentKey, $variationKey);
        $impressionParams = $this->getImpressionParams($experiment, $variation->getId());

        $eventParams[VISITORS][0][SNAPSHOTS][] = $impressionParams;

        return new LogEvent(self::$ENDPOINT, $eventParams, self::$HTTP_VERB, self::$HTTP_HEADERS);
    }
public function createImpressionEvent($config, $experimentKey, $variationKey, $userId, $attributes)
    {
        $eventParams = $this->getCommonParams($config, $userId, $attributes);

        $experiment = $config->getExperimentFromKey($experimentKey);
        $variation = $config->getVariationFromKey($experimentKey, $variationKey);
        $impressionParams = $this->getImpressionParams($experiment, $variation->getId());

        $eventParams[VISITORS][0][SNAPSHOTS][] = $impressionParams;

        return new LogEvent(self::$ENDPOINT, $eventParams, self::$HTTP_VERB, self::$HTTP_HEADERS);
    }
public function createImpressionEvent ( $ config , $ experimentKey , $ variationKey , $ userId , $ attributes ) { $ eventParams = $ this -> getCommonParams ( $ config , $ userId , $ attributes ) ; $ experiment = $ config -> getExperimentFromKey ( $ experimentKey ) ; $ variation = $ config -> getVariationFromKey ( $ experimentKey , $ variationKey ) ; $ impressionParams = $ this -> getImpressionParams ( $ experiment , $ variation -> getId ( ) ) ; $ eventParams [ VISITORS ] [ 0 ] [ SNAPSHOTS ] [ ] = $ impressionParams ; return new LogEvent ( self :: $ ENDPOINT , $ eventParams , self :: $ HTTP_VERB , self :: $ HTTP_HEADERS ) ; }
Create impression event to be sent to the logging endpoint.

@param $config ProjectConfig Configuration for the project.
@param $experimentKey Experiment Experiment being activated.
@param $variationKey string Variation user
@param $userId string ID of user.
@param $attributes array Attributes of the user.

@return LogEvent Event object to be sent to dispatcher.
Create impression event to be sent to the logging endpoint .