Closed alien-rat closed 8 months ago
Hi @alien-rat, you could add a custom cookie and attach the Facebook Pixel script to the consent response using the accepted
closure. More information here: https://github.com/whitecube/laravel-cookie-consent/tree/main?tab=readme-ov-file#acceptedclosure-callback
Since Facebook's Pixel is a popular addition, I'd be happy to accept a PR that would make its configuration within this package easier. Please let me know how you ended up implementing it! :)
sorry but i tried evertyhing, but its not working at all.. $category = Cookies::category(key: 'accepted'); Cookies::accepted() // Targetting a category ->cookie(function(Cookie $cookie) { $cookie->accepted(function(Consent $consent) { $consent->cookie(value: 'off')->script(''); }); }); error: App\Providers\CookiesServiceProvider::App\Providers{closure}(): Argument #1 ($cookie) must be of type App\Providers\Cookie, Whitecube\LaravelCookieConsent\Cookie given, called in
Hellow, how do i add facebook pixel?
lp Miha