> ## Documentation Index
> Fetch the complete documentation index at: https://dhiwisepvtltd-5e04e6a4.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AdSense

> Connect Google AdSense to Rocket and add display ads to your app - banner placements, in-article ads, and in-feed units, all wired up from chat.

Describe where you want ads to appear in chat and Rocket generates the placement code, responsive ad units, and layout adjustments automatically.

## What you can do

> **Blog monetization**
>
> Place ads between articles, in the sidebar, and after post content to generate revenue from your blog traffic.

> **Banner ads**
>
> Insert standard IAB ad units - leaderboard, medium rectangle, skyscraper - throughout your app.

> **In-article ads**
>
> Insert ads after specific paragraphs in long-form content without disrupting the reading experience.

> **In-feed ads**
>
> Insert native-looking ads between items in content feeds, product listings, or search results.

## Before you connect

You need your **Publisher ID** from Google AdSense. It looks like `pub-1234567890123456`.

> **Find your Publisher ID in the AdSense help center**
>
> [Open](https://support.google.com/adsense/answer/105516)

> [!NOTE]
>
> Your Publisher ID (`pub-XXXXXXXX`) is embedded in your page's public HTML source and is not a secret. Entering it in the connection popup carries no security risk.

> [!NOTE]
>
> AdSense is a **task-level** connector. Each Rocket task connects to its own Publisher ID independently.

## Connect AdSense

**Web Browser**

You can connect from two places - both open the same popup.

**Option 1: From chat**

Type a prompt that mentions AdSense - for example, `Connect AdSense and add a banner ad to the homepage`. Rocket detects the intent and shows a **Connect** button inline. Click it and the popup opens.

![AdSense connection prompt in the Rocket chat panel.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-chat-light.webp)

![AdSense connection prompt in the Rocket chat panel.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-chat-dark.webp)

AdSense connection prompt in chat

**Option 2: From the Connectors tab**

Click the **`...`** button in the preview toolbar, then select **Connectors**.

Open Connectors from the toolbar

Click the **AdSense** card, then click **Connect**.

![Connectors panel showing the AdSense card with a Connect button.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-click-connect-light.webp)

![Connectors panel showing the AdSense card with a Connect button.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-click-connect-dark.webp)

AdSense card in the Connectors panel

**After clicking Connect**

A popup opens. Enter your **Publisher ID**, then click **Connect**. A green dot appears next to AdSense when the connection is active.

![Connect AdSense popup with Publisher ID field.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-popup-light.webp)

![Connect AdSense popup with Publisher ID field.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-popup-dark.webp)

Connect AdSense popup

**Update or disconnect**

Go to [**Connectors > AdSense**](#connect-adsense). Click **Edit** to update your Publisher ID or **Disconnect** to remove the integration.

![AdSense card showing Edit and Disconnect buttons.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-edit-disconnect-light.webp)

![AdSense card showing Edit and Disconnect buttons.](https://mintlify.s3.us-west-1.amazonaws.com/dhiwisepvtltd-5e04e6a4/images/build/connectors/adsense/adsense-edit-disconnect-dark.webp)

Edit and Disconnect options on a connected AdSense card

**Mobile App**

You can connect from two places - both open the same popup.

**Option 1: From chat**

Type a prompt that mentions AdSense. Rocket detects the intent, shows a **Connect** button, and the popup opens when you tap it.

**Option 2: From the Connectors tab**

1. Tap the **More** button in the header.
2. Tap **Integrations**.
3. Tap the **AdSense** card, then tap **Connect**.

**After tapping Connect**

A popup opens. Enter your **Publisher ID**, then tap **Done**.

A green dot appears next to AdSense when the connection is active.

**Update or disconnect**

Go back to the **AdSense** card in Integrations. Tap **Edit** to update your Publisher ID or **Disconnect** to remove it from this task.

## Example prompts

| What you want | Prompt to use |
| :- | :- |
| Header banner | `Add a responsive AdSense leaderboard ad below the navigation bar on every page.` |
| Sidebar ad | `Place a 300x250 medium rectangle AdSense ad in the sidebar, sticky on scroll.` |
| In-article ad | `Insert an AdSense ad after the third paragraph of every blog post.` |
| In-feed ad | `Add an AdSense in-feed ad after every 5th post in my blog listing.` |
| Footer ad | `Place a responsive AdSense banner above the footer on all pages.` |
| Mobile-only ad | `Show a full-width AdSense ad between content sections, only on mobile devices.` |
| Desktop-only ad | `Add a skyscraper ad in the right sidebar, visible only on desktop screens wider than 1024px.` |
| Between sections | `Insert an AdSense ad between the features section and the testimonials section on the landing page.` |

## Tips

* **Ads only display on deployed tasks.** AdSense will not render in the Rocket preview. Deploy your task and test on the live URL.
* **Google must approve your site.** Your domain and content must comply with [AdSense program policies](https://support.google.com/adsense/answer/48182) before ads appear. Approval can take days to weeks. New sites with thin or limited content may be rejected, so ensure your site has substantial, original content before applying.
* **Ad blockers will hide ads.** A significant percentage of users run ad-blocking extensions. Keep this in mind when projecting revenue.
* **Too many ads hurt user experience.** Google may limit ad serving if your page has an unfavorable content-to-ad ratio. Follow AdSense best practices for ad density.
* **One Publisher ID per task.** Each Rocket task connects to one AdSense account. Use different tasks for different Publisher IDs.

## What's next?

> **[Google Analytics](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/google-analytics.md)**
>
> Track how ads affect user engagement and bounce rates with GA4.

> **[Strapi](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/strapi.md)**
>
> Pair AdSense with a headless CMS to monetize your content-driven site.

> **[Netlify](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/netlify.md)**
>
> Deploy your task so AdSense can start serving ads on your live site.

> **[All connectors](https://dhiwisepvtltd-5e04e6a4.mintlify.site/build/connectors/overview.md)**
>
> Browse every available integration.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.