This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
class TestAddressController extends AbstractController | |
{ | |
/** | |
* @var SerializerInterface | |
*/ | |
private $serializer; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
private $country; | |
public function getName(): ?string | |
{ | |
return $this->name; | |
} | |
public function getLineOne(): ?string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Entity; | |
class TestAddress | |
{ | |
/** @var string */ | |
private $name; | |
/** @var string */ | |
private $lineOne; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
class TestAddressController extends AbstractController | |
{ | |
/** | |
* @Route("/test/address", methods={"POST"}) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\Routing\Annotation\Route; | |
class TestAddressController extends AbstractController | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
class TestAddressController extends AbstractController | |
{ | |
/** | |
* @Route("/test/address", methods={"POST"}) | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function () { | |
var name = '_gid' | |
var re = new RegExp(name + "=([^;]+)"); | |
var value = re.exec(document.cookie); | |
return (value != null) ? unescape(value[1]) : '(not set)'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function () { | |
var name = '_ga' | |
var re = new RegExp(name + "=([^;]+)"); | |
var value = re.exec(document.cookie); | |
return (value != null) ? unescape(value[1]) : '(not set)'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#authorization | |
gc = pygsheets.authorize(service_file='google_credentials.json') | |
#open the google spreadsheet (where 'PY to Gsheet Test' is the name of my sheet) | |
sh = gc.open("Multi-touchpoint attribution model - Talent Acquisition") | |
#select the first sheet | |
wks = sh[1] | |
#update the first sheet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Setting up the empty dataframe that will be filled with the attributed conversions | |
columns = ['date', 'utm_medium', 'conversions'] | |
attributed_conversion_df = pd.DataFrame(columns=columns) | |
#looping over all the rows of the raw GA dataframe | |
for index, row in ga_raw_data.iterrows(): | |
#looking for rows that have at least 1 conversion | |
if row['submitted_applications'] > 0: | |
#create a dataframe with the conversion raw and all former sessions of this user | |
single_conversion_df = ga_raw_data[(ga_raw_data['date'] <= pd.to_datetime(row["date"])) & (ga_raw_data['user_id'] == row["user_id"])] | |
#sorting by date and number of conversion ascending |