Track campaign fields with company

This commit is contained in:
Hillel Coren 2016-11-06 14:16:18 +02:00
parent 0a20460242
commit 26f4a84897
3 changed files with 12 additions and 8 deletions

View File

@ -76,10 +76,8 @@ class HomeController extends BaseController
}
// Track the referral/campaign code
foreach (['rc', 'utm_campaign'] as $code) {
if (Input::has($code)) {
Session::set(SESSION_REFERRAL_CODE, Input::get($code));
}
if (Input::has('rc')) {
Session::set(SESSION_REFERRAL_CODE, Input::get('rc'));
}
if (Auth::check()) {

View File

@ -2,6 +2,7 @@
use Auth;
use Request;
use Input;
use Session;
use Utils;
use URL;
@ -27,6 +28,11 @@ class AccountRepository
public function create($firstName = '', $lastName = '', $email = '', $password = '')
{
$company = new Company();
$company->utm_source = Input::get('utm_source');
$company->utm_medium = Input::get('utm_medium');
$company->utm_campaign = Input::get('utm_campaign');
$company->utm_term = Input::get('utm_term');
$company->utm_content = Input::get('utm_content');
$company->save();
$account = new Account();

View File

@ -2,7 +2,7 @@
@section('body')
{!! Form::open(array('url' => 'get_started', 'id' => 'startForm')) !!}
{!! Form::open(array('url' => 'get_started?' . request()->getQueryString(), 'id' => 'startForm')) !!}
{!! Form::hidden('guest_key') !!}
{!! Form::hidden('sign_up', Input::get('sign_up')) !!}
{!! Form::hidden('redirect_to', Input::get('redirect_to')) !!}