Monetizing Your Next.js Website with Journey by Mediavine

A step-by-step developer guide to implementing, configuring, and optimizing Journey ads on your Next.js application.
π Table of Contents
- Introduction
- Prerequisites
- Phase 1: Applying to Journey by Mediavine
- Phase 2: Adding the Journey Script to Next.js
- Phase 3: Sitemap Configuration
- Phase 4: Sidebar Implementation for Desktop Ads
- Phase 5: Configuring Journey Dashboard
- Phase 6: Verification and Troubleshooting
- Best Practices
- Common Issues and Solutions
Introduction
Journey by Mediavine (formerly known as Grow) is a premium ad management platform that offers higher RPMs than traditional ad networks like Google AdSense. Unlike AdSense, Journey uses advanced header bidding technology, which allows multiple ad exchanges to compete for your ad inventory in real-time.
This guide walks you through the complete process of implementing Journey on a Next.js website, with special focus on:
- Script Integration - How to properly add Journey code to a Next.js app
- Sidebar Targeting - Enabling Journey to recognize and monetize your sidebar
- SEO Considerations - Maintaining site performance and Core Web Vitals
- Dashboard Configuration - Setting up your Journey account for maximum revenue
Prerequisites
Before you begin, ensure you have:
- β A Next.js 13+ application (App Router or Pages Router)
- β At least 10,000 monthly sessions (Journey's minimum requirement)
- β Quality, original content
- β
A properly configured
sitemap.xml - β Mobile-responsive design
- β HTTPS enabled on your domain
Phase 1: Applying to Journey by Mediavine
Step 1.1: Create Your Account & Check Eligibility
- Visit Journey by Mediavine
- Click "Apply Now"
- Submit your website URL and traffic analytics
π Traffic Requirement Note
While the standard requirement is 10,000 monthly sessions, Journey sometimes accepts websites with lower traffic if the traffic quality is high and originates primarily from Tier 1 countries (USA, Canada, UK, and Australia). Don't hesitate to apply if you have quality content but are slightly under the limit.
Step 1.2: The Approval Process
- Verification: You must install the Grow.me verification script (see Phase 2) to prove ownership.
- Review: Mediavine checks your content quality and traffic sources.
- Timeline: Approval typically takes 3-7 business days.
Phase 2: Adding Journey Scripts to Next.js
There are two distinct scripts involved in the process: one for verification (before approval) and one for ads (after approval).
Step 2.1: Site Verification Script (Pre-Approval)
Immediately after applying, you need to add this script to your layout.tsx to verify site ownership. Use the exact code below, helping Journey verify your site:
{/* Journey by Mediavine (Grow.me) - Site Verification */}
<script
data-grow-initializer=""
dangerouslySetInnerHTML={{
__html: `
!(function() {
window.growMe || (window.growMe = function(e) {
window.growMe._.push(e);
}, window.growMe._ = []);
var e = document.createElement("script");
e.type = "text/javascript";
e.src = "https://faves.grow.me/main.js";
e.defer = true;
e.setAttribute("data-grow-faves-site-id", "YOUR_SITE_ID_HERE"); // <-- REPLACE THIS ID
var t = document.getElementsByTagName("script")[0];
t.parentNode.insertBefore(e, t);
})();
`,
}}
/>Action: Replace YOUR_SITE_ID_HERE with the ID provided in your Journey dashboard during setup.
Step 2.2: Ad Script (Post-Approval)
Once you receive the "Congratulations!" email, you'll need to add the ad script. This is what actually displays the ads.
Add this Script component to your app/layout.tsx, preferably below the verification script:
{/* Journey by Mediavine Code - to show Ads */}
<Script
id="mediavine-journey"
src="https://scripts.scriptwrapper.com/tags/YOUR_TAG_ID_HERE.js" // <-- REPLACE THIS ID
data-noptimize="1"
data-cfasync="false"
/>Action: Replace YOUR_TAG_ID_HERE with the unique ID from your approval email or dashboard (the part after tags/).
Phase 3: Sitemap Configuration
A well-structured sitemap helps Journey understand your content. Create a dynamic sitemap in Next.js:
// app/sitemap.ts
import { MetadataRoute } from "next";
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = "https://gpacalculators.net";
const pages = [
"",
"/about",
"/calculator-1",
"/calculator-2",
];
return pages.map((route) => ({
url: `${baseUrl}${route}`,
lastModified: new Date().toISOString(),
changeFrequency: route === "" ? "daily" : "weekly",
priority: route === "" ? 1.0 : 0.8,
}));
}Phase 5: Configuring Journey Dashboard
Configuring the Sidebar Selector
This is the most critical step for sidebar ads:
- Log in to your Journey Dashboard
- Navigate to Settings β Ad Placements
- Find "Sidebar Selector"
- Enter your CSS selector:
.sidebar-main, .mv-sidebar, aside[role="complementary"]Enabling Ad Types
| Ad Type | Description | Recommendation |
|---|---|---|
| In-Content Ads | Between paragraphs | β Enable |
| Sticky Sidebar | Follows scroll on desktop | β Enable |
| Anchor Ads | Fixed to bottom | β Enable |
| Video Ads | Corner video player | β Enable (Higher RPM) |
| Recommended Content | Content suggestions | β Enable |
Phase 6: Verification and Troubleshooting
Verifying Script Installation
Open your browser's Developer Tools (F12) and check:
// In Console tab
console.log(window.growMe); // Should return a function
// Check sidebar elements
document.querySelectorAll('.sidebar-main, .mv-sidebar').length;
// Should return 1 or moreTimeline for Ad Appearance
- Anchor Ads: Immediate (within hours)
- In-Content Ads: 24-48 hours
- Sidebar Ads: 24-72 hours
- Video Ads: 24-48 hours
- Recommended Widget: Immediate
β Success Indicator
If you see the "Recommended Content" widget appearing in your sidebar, your sidebar selector is working correctly. The sticky ad will follow within 24-72 hours.
Best Practices
Performance Optimization
- Use
afterInteractiveloading strategy to prevent blocking page render - Lazy load below-fold content to improve Core Web Vitals
- Reserve space for ads with
minHeightto minimize layout shifts
Revenue Optimization
- Content length matters - Longer pages = more ad slots
- Regular content updates - Fresh content attracts more traffic
- Mobile optimization - Growing share of ad revenue
- Multiple pages - More pageviews = more impressions
Common Issues and Solutions
Issue: Sidebar Ads Not Appearing
Symptoms: Recommended widget shows, but no sticky ad
Solutions:
- Check if sidebar has
position: stickyorfixed(remove it) - Verify
overflow: visibleis set - Wait 24-48 hours for new placements to fill
- Ensure sidebar is tall enough (at least 600px)
Issue: Layout Shift from Ads
Symptoms: Content jumps when ads load
Solution: Add minHeight to ad containers:
<div id="sidebar_atf_target" style={{ minHeight: "250px" }} />Summary Checklist
- β Journey script added to
layout.tsxwithafterInteractivestrategy - β Site ID is correct in the script
- β Sidebar component uses
position: relative(NOT sticky) - β Sidebar has
overflow: visible - β Target divs have proper IDs (
sidebar_atf_target,sidebar_btf_target) - β ARIA attributes added to
<aside>elements - β CSS selector configured in Journey dashboard
- β Ad types enabled in Journey dashboard
- β Sitemap is accessible and up-to-date
- β Tested on both mobile and desktop
Conclusion
Implementing Journey by Mediavine on a Next.js website requires attention to detail, but the revenue potential makes it worthwhile. By following this guide, you've set up:
- Proper script integration that doesn't block page rendering
- Optimized sidebar targeting for high-value desktop ads
- SEO-friendly configuration that protects your Core Web Vitals
- Correct dashboard settings for maximum ad fill rates
Remember: Sidebar sticky ads may take 24-72 hours to appear after initial setup. The "Recommended Content" widget appearing in your sidebar is a positive sign that Journey has correctly identified your sidebar.
About this guide: This guide was created based on real-world implementation experience with Next.js 15 and Journey by Mediavine. Last updated: December 2025.