getParams()); if (false === $value) { return $value; } $value = trim($value); return substr($value, 0, 255); } /** * If the value you want to save for your dimension is something like a page title or page url, you usually do not * want to save the raw value over and over again to save bytes in the database. Instead you want to save each value * once in the log_action table and refer to this value by its ID in the log_link_visit_action table. You can do * this by returning an action id in "getActionId()" and by returning a value here. If a value should be ignored * or not persisted just return boolean false. Please note if you return a value here and you implement the event * "onNewAction" the value will be probably overwritten by the other event. So make sure to implement only one of * those. * * @param Request $request * @param Action $action * * @return false|mixed public function onLookupAction(Request $request, Action $action) { if (!($action instanceof ActionPageview)) { // save value only in case it is a page view. return false; } $value = Common::getRequestVar('my_page_keywords', false, 'string', $request->getParams()); if (false === $value) { return $value; } $value = trim($value); return substr($value, 0, 255); } */ /** * An action id. The value returned by the lookup action will be associated with this id in the log_action table. * @return int public function getActionId() { return Action::TYPE_PAGE_URL; } */ }