An announcement bar with a location-based message.

Introduction

This template shows how to implement location-based content using Croct slots. It enables dynamic messages based on the visitor's IP location, region, or locale, such as country, state, or city.

Built with the announcement bar component, it can be integrated into an existing project or used to scaffold a new Next.js application.

It is a good alternative for IP geolocation APIs and ideal for geomarketing strategies, geo-targeted campaigns, localized user experiences, and IP-based customization. Additionally, it is fully integrated with Croct, providing you with a headless CMS, AB testing, and ready-to-use location-based personalization.

Usage

To create a new project using this template, run:

npx croct@latest use croct://location/geomarketing

You can customize the template by specifying options:

npx croct@latest use croct://location/geomarketing --router=page

Options

The following options are available for this template:

OptionDescriptionRequiredDefault
projectNameThe name of the project.Nomy-app
versionThe Next.js version to use.Nolatest
routerThe router to use (app or page).Noapp
javascriptWhether to use JavaScript instead of TypeScript.Nofalse

Start building in seconds

Paste the following command in your terminal and let the CLI do the rest.

npx croct@latest init