Keep AdSense rendering limited to anonymous visitors.
Show guest-only ad units on public pages and skip the AdSense script entirely for signed-in users.
This commit is contained in:
@@ -64,6 +64,22 @@ it('authenticated home page sends private cache headers', function () {
|
||||
->toContain('no-store');
|
||||
});
|
||||
|
||||
it('authenticated home page does not render ads', function () {
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/')
|
||||
->assertOk()
|
||||
->assertDontSee('data-ad-slot="8766048277"', false)
|
||||
->assertDontSee('pagead2.googlesyndication.com', false);
|
||||
});
|
||||
|
||||
it('guest home page renders the dashboard horizontal ad', function () {
|
||||
$this->get('/')
|
||||
->assertOk()
|
||||
->assertSee('data-ad-slot="8766048277"', false);
|
||||
});
|
||||
|
||||
it('home page includes a canonical link tag', function () {
|
||||
$this->get('/')
|
||||
->assertStatus(200)
|
||||
|
||||
Reference in New Issue
Block a user