This file contains 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
/* | |
First-Click, Last-Click, Even-Click and Time Decay Attribution for GA4 | |
Replace "event_name in ('Contact Us','Contact Us Clicked','CTA Pressed','Form Submitted')" with the name(s) of your conversion event in lines 54, 57, 61 and 76 | |
*/ | |
WITH | |
events AS ( | |
SELECT | |
event_timestamp as event_ts, | |
user_pseudo_id AS user_pseudo_id, | |
user_id, |
This file contains 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
FROM php:7.4-fpm | |
RUN apt-get update && apt-get install -y libldb-dev libldap2-dev libzip-dev libpng-dev libjpeg62-turbo-dev libfreetype6-dev \ | |
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \ | |
&& docker-php-ext-install -j$(nproc) zip pdo pdo_mysql gd ldap pcntl opcache |
This file contains 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
trait CreatesWithLock | |
{ | |
public static function updateOrCreate(array $attributes, array $values = []) | |
{ | |
return static::advisoryLock(function () use ($attributes, $values) { | |
// emulate the code found in Illuminate\Database\Eloquent\Builder | |
return (new static)->newQuery()->updateOrCreate($attributes, $values); | |
}); | |
} |
This file contains 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
// initialise various variables | |
var page = require('webpage').create(), | |
system = require('system'), | |
address; | |
// how long should we wait for the page to load before we exit | |
// in ms | |
var WAIT_TIME = 5000; | |
// if the page hasn't loaded after this long, something is probably wrong. |
This file contains 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\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |
This file contains 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\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Response; | |
class DBTransaction | |
{ | |
/** | |
* Handle an incoming request. | |
* |