protected function recordStandardGoals(VisitProperties $visitProperties, Request $request, $goal, $action)
{
$visitor = Visitor::makeFromVisitProperties($visitProperties, $request);
$convertedGoals = $request->getMetadata('Goals', 'goalsConverted') ?: array();
foreach ($convertedGoals as $convertedGoal) {
$this->currentGoal = $convertedGoal;
Common::printDebug("- Goal " . $convertedGoal['idgoal'] . " matched. Recording...");
$conversion = $goal;
$conversion['idgoal'] = $convertedGoal['idgoal'];
$conversion['url'] = $convertedGoal['url'];
if (!is_null($action)) {
$conversion['idaction_url'] = $action->getIdActionUrl();
$conversion['idlink_va'] = $action->getIdLinkVisitAction();
}
// If multiple Goal conversions per visit, set a cache buster
$conversion['buster'] = $convertedGoal['allow_multiple'] == 0 ? '0' : $visitProperties->getProperty('visit_last_action_time');
$conversionDimensions = ConversionDimension::getAllDimensions();
$conversion = $this->triggerHookOnDimensions($request, $conversionDimensions, 'onGoalConversion', $visitor, $action, $conversion);
$this->insertNewConversion($conversion, $visitProperties->getProperties(), $request);
}
}