Visitor location with MaxMind GeoIP in Mautic

Set up MaxMind GeoIP lookups in your self-hosted Mautic instance, confirm what city-level data it writes and plan the CCPA purge behavior before you rely on it in segments or content.

On this page

How MaxMind GeoIP lookups fit into Mautic visitor tracking

This section explains where MaxMind GeoIP sits in Mautic visitor tracking, so a marketing or platform lead can decide whether location-based segments and content are worth the setup. The rest of this page covers configuring the MaxMind AccountID and LicenseKey, the automatic database updates, which city-level fields Mautic uses and the CCPA purge behavior. Mautic's IP lookup is a built-in feature configured in its settings, not a separate add-on, but the exact configuration screens and the update mechanism must be confirmed against the documentation for the Mautic version you run, because these details change between release lines.

The lookup runs when Mautic records a tracked visit or identifies a contact by IP address. Mautic resolves the visitor's IP against a local MaxMind database and stores the resulting location on the contact or visit record. That location then becomes available to segment filters, campaign conditions and dynamic web content. Because the lookup depends on the tracking script and on the IP address the request arrives with, the reverse proxy and load balancer settings on your server determine whether Mautic sees the visitor's address or the address of your own infrastructure. Confirm this path in a test instance before planning any location-based campaign, since a misconfigured proxy produces location data that looks plausible but describes the wrong network.

Plan the decision before the configuration. Ask who owns the MaxMind account, where the license key is stored and who receives the lookup data in segment and content rules. Location is personal data when it is linked to a contact, so the consent and retention rules your compliance team already applies to Mautic contacts also apply here. Ask your team to confirm how the CCPA purge works in the version you run, how often it executes through the scheduled jobs described in the Mautic cron documentation, and whether purged records affect existing segments. Verify the result with a test contact before you rely on it for targeting. The Mautic cron jobs documentation is the natural next read for the scheduling side.

What you need before enabling MaxMind GeoIP in Mautic

MaxMind GeoIP lookup depends on a healthy Mautic installation, a server that can reach MaxMind, and an account you control. Check each item below before you change any IP lookup settings, because gaps in the platform or the network stack will surface as failed database downloads or stale location data.

A supported Mautic release line

Start from a release line that still receives fixes. Mautic 7.2 (Absolunto) has active and security support until 30 September 2026, and Mautic 7.3 is planned as the long-term support release with security support through 31 December 2027. Mautic 6.0 and 5.2 have earlier end dates, so confirm the current support status on the releases page before you plan a configuration change that you expect to keep for years.

Mautic releases

PHP and database versions

Mautic 7.0 requires PHP 8.2, 8.3, 8.4 or 8.5, and MySQL 5.7 or higher with InnoDB, or MariaDB 10.2 or higher. Confirm the exact PHP extensions your build needs and that the database engine is InnoDB, because the lookup data is stored alongside contact records. Check your version against the requirements page before the upgrade or install.

Mautic requirements

A VPS or dedicated server

The Mautic project advises against shared hosting and recommends a VPS or dedicated server. Shared plans often restrict the background jobs and outbound connections that GeoIP updates need, and they limit control over PHP and cron. Confirm that your host gives you root or equivalent access, scheduled tasks, and enough resources for the cron jobs Mautic runs.

A MaxMind account and license key

Create the MaxMind account under an organizational mailbox that outlives individual staff, then generate a license key. Mautic expects the credential in the AccountID:LicenseKey format. Confirm directly with MaxMind which account type, license terms and database products your organization is entitled to use, since those terms govern how you may use the data and are not set by Mautic.

Outbound access for database downloads

The server must reach MaxMind's download endpoints so Mautic can fetch database files on a schedule. Check that egress firewall rules, proxies and DNS allow the connection from the web or cron host, and that certificate trust is in place. Failed downloads usually show up as stale or missing location data rather than as a visible error, so test the fetch before you rely on it.

Cron jobs and a tested rollback

Automatic database updates depend on Mautic's scheduled jobs running reliably. Confirm that cron runs as the correct user, that jobs are staggered as the documentation advises, and that you have a recent backup of the database and configuration. Record how you would disable the lookup again, so a bad credential or license change can be reverted without losing contact data.

Mautic cron jobs

Configuring the AccountID and LicenseKey in Mautic

This sequence connects Mautic's IP lookup to a MaxMind account so that visitor IP addresses can be resolved to location data. Each step ends with a check, so you can confirm the lookup works before relying on it in segments, campaigns or reports.

  1. Confirm the MaxMind account and license key

    Your team, or the MaxMind account owner, creates a MaxMind account or signs in to an existing one and confirms that a license key exists for the GeoIP database product. Record the numeric AccountID shown in the account and keep the license key with your other secrets, not in a shared document. Check: you can see both values in the account and the license key is listed as active.

  2. Combine the AccountID and LicenseKey

    Join the two values into one string in the form AccountID:LicenseKey, with a single colon, no spaces and no line breaks. Mautic's IP lookup settings expect this combined value, so a stray space or a copied newline is a common cause of failed downloads. Check: paste the string into a plain text editor and confirm it has exactly one colon and no leading or trailing characters.

  3. Enter the credentials in Mautic settings

    A Mautic administrator opens the configuration area for IP lookup and places the combined string in the field for the MaxMind service. Confirm the exact field name and the selected lookup service in the documentation for the Mautic version you run, because settings labels change between releases. Check: save the configuration, reload the page and confirm the value is retained and that no validation error appears.

  4. Confirm the database storage path is writable

    The server administrator checks the directory where Mautic stores the downloaded GeoIP database and confirms that the PHP process running Mautic can write to it. Permissions set during installation are often the reason a download appears to succeed but no file is created. Check: list the directory as the web server user and confirm the directory is owned or group-writable by that user.

  5. Trigger or wait for the first database download

    Start the first download from the Mautic interface or the command that the documentation for your version describes, or wait for the scheduled job to run if your version downloads on a schedule. Confirm in the cron job documentation that the relevant job is installed and running, since Mautic relies on cron for several background tasks. Check: the database file exists in the storage path with a current timestamp, and the Mautic logs show no download errors.

  6. Test a visit from a known public IP address

    Load a tracked page from a network with a public IP address that you can identify, such as a test network your team controls, while logged out of Mautic. Wait for the visit to reach Mautic, then find the anonymous or known contact record that the visit created. Check: the record shows the IP address and populated location fields such as country, and the city where the data supports it.

  7. Review logs for lookup failures

    Review the Mautic logs and any web server or PHP error logs for the period of the test to confirm that lookups complete without repeated errors. Repeated authentication errors usually point to the combined credential string, while missing data for private or internal addresses is expected because those ranges cannot be located. Check: a short run of test visits produces location data without new errors, and you have recorded the test IP and the result for your change record.

How a visitor IP becomes a location field in Mautic

The flow starts in the visitor's browser, which loads the Mautic tracking script from the public website and sends a page hit to the Mautic server. The server resolves the request IP against a MaxMind GeoIP database and writes the resulting location values to the contact record. Segment filters, dynamic content and campaign conditions then read those fields. The database refresh step depends on the update method you configure, which needs to be confirmed in your own environment before go-live.

Visitor IP flows from the browser through Mautic into contact fields that drive targeting.

What city-level data Mautic uses it for

Before you build anything on location, list every feature that will read the location fields the GeoIP lookup writes to a contact. Those fields typically include city, region and country, and the lookup can only populate what the database and the visitor's network can supply. Write the list down with the owner of each feature, then confirm in the Mautic documentation for your exact version how each one reads those fields. The main candidates are segment filters on location, dynamic web content that changes by region, campaign conditions that branch on location, and reports that group contacts by geography. Treat any feature you cannot confirm as unsupported until a test proves otherwise.

City-level accuracy is the weak point of IP-based location. The result depends on the MaxMind database edition you license and on the visitor's network, so a mobile carrier, a corporate VPN or a proxy can place a visitor in the wrong city or only in the right country. The same visitor can resolve differently on two days if the network changes. Before you base a campaign on a city, create a test segment with a small set of known contacts, include staff on different networks, and check that the contacts land where you expect. Record the results so the marketing team knows which segments are reliable enough for personalization and which should only drive broad country-level messaging.

Plan for the consequences of the data you store. Location data attached to a contact is personal data under most privacy rules, so a segment built on city must be reviewed with your privacy team along with the consent and retention settings that apply to that contact. Decide which location fields you actually need, remove the ones no feature reads, and document the purpose for each one. Ask your privacy and legal advisers whether the CCPA purge described above fits your retention commitments, because a purge removes data that some reports or segments may still depend on.

Choosing city-level, country-level or no lookup

Teams that want to vary page content, event invitations or segments by city need the most detailed output the lookup offers. This is also the option that brings the widest privacy review, because city, region and country become personal data attached to contact and visitor records.

  • Data collected: IP-derived city, region and country, written to contact and anonymous visitor records once the lookup runs. Confirm exactly which fields Mautic writes for your release.
  • Uses it supports: Dynamic web content by city, segments for regional events, and campaign conditions tied to a metro area.
  • Privacy review: Expect the assessment to cover the precision of the data, how long location history is kept, and whether your privacy notice tells visitors that location is inferred from IP addresses.
  • Accuracy limits: IP geolocation is approximate, and mobile networks and VPNs often place visitors in the wrong city. Test city rules with addresses you control before relying on them.
  • Account setup: The MaxMind account credential in the AccountID:LicenseKey format must be in place before the database downloads automatically.

Before choosing city-level targeting, confirm in the Mautic documentation for your version which lookup fields are stored, how the database update runs and how the CCPA-related purge behaves.

How the CCPA purge affects location data

The CCPA purge is a data handling setting, not a legal position, so its effect depends on what it removes, what your segments rely on and what your privacy rules require. The cards below cover the decisions to settle and confirm in the Mautic documentation for your installed version before anyone switches it on.

Confirm purge scope and trigger

Before you enable the purge, confirm in the Mautic documentation for your installed version which location fields it removes or limits, what triggers it and how often it runs. Do not assume it matches the city-level data you see in contact records. Record the answers in your configuration evidence so reviewers can see what the setting does.

Cron jobs docs

Map fields to purpose

List each location field Mautic stores for a contact, such as city, region and country, and note which marketing purpose it serves. Some fields may be needed for segments or dynamic content while others exist only as by-products of IP lookup. This mapping tells you which fields the purge can safely remove and which need a different control.

Assess effect on existing segments

A segment that filters on city or region may return different contacts after location data is purged or limited. Illustrative example: a regional campaign built on a city filter could stop matching contacts overnight. Review every segment and campaign condition that reads location data, decide whether it should change, and test the result on a copy of your contact data before production use.

Align with consent records

Purging location data does not replace the consent records your team keeps for marketing contacts. Decide whether consent, preference and opt-out data stay untouched by the purge, and document that they are kept separately. Confirm with your privacy lead how these records relate to the location data you remove.

Set retention periods

Define how long location data is kept for anonymous visitors and known contacts, and whether the purge timing matches that schedule. Retention and purge rules can conflict if one runs on a different clock. Write the agreed periods down, and check how your backups handle location data that has been purged from the live database.

Agree sign-off and ownership

Name who approves the purge setting, who owns its configuration and who reviews changes after upgrades. Privacy, legal and marketing operations usually need to agree on scope before a change goes live. DeployOpen prepares configuration and evidence for that review but does not issue legal opinions or compliance certifications, so the final decision stays with your organization and its advisers.

Mapping location fields to their uses and retention

This table lists each location value a GeoIP lookup or the tracking script can write, where Mautic reads it, and the retention rule and approver to settle before lookup is enabled. Confirm each field name and purge behavior in Mautic's contact field settings and documentation for your version before you sign off the mapping.

Field or outputSourceMautic features that read itRetention and approver
IP addressTracking script or form submission, stored on the contactInput to the GeoIP lookup and identify-by-IP, not a common segment filterKept with the contact record. Approver: privacy lead. Confirm deletion behavior.
CityGeoIP lookup against the MaxMind database, written to the contactSegment filters, dynamic content rules, campaign conditions (confirm availability)Follows the contact lifecycle and the CCPA purge. Approver: marketing operations with privacy sign-off.
Region or stateGeoIP lookup against the MaxMind databaseDynamic content and segment filters (confirm field name)Same as city. Approver: marketing operations with privacy sign-off.
CountryGeoIP lookup against the MaxMind databaseSegments, dynamic content and contact geography reportsFollows the contact lifecycle. Often the broadest approved use. Approver: marketing lead.
Timezone and localeBrowser detection by the tracking script, not the GeoIP lookup (confirm)Campaign send timing and dynamic contentConfirm whether the script sets these on your version. Approver: marketing operations.
GeoIP database file and update scheduleInstallation and the scheduled database downloadNot read by campaigns or segments. Administrators check it.Stored on the server and refreshed on the schedule you set. Approver: platform administrator.
Exports and reports containing locationContact exports, reports and scheduled extractsReports, bulk exports and third-party syncsCopies sit outside Mautic. Set an export rule and deletion schedule. Approver: data protection officer.

Protecting the MaxMind license key and update path

The MaxMind AccountID and LicenseKey let your Mautic server download GeoIP databases on a schedule, so they carry real access and exposure risk. The controls below cover who can read the credentials, who can change IP lookup settings, what the server can reach over the network, how changes are recorded and how the key is rotated.

Limit who can read the credentials

The AccountID and LicenseKey are entered in the IP lookup configuration, so anyone who can view that configuration may be able to copy them. Confirm with your Mautic administrator whether the values are stored in the database, in the local configuration file or in an environment variable, because that choice decides which system administrators can reach them. Restrict read access to the people who run the Mautic installation and keep the key out of shared runbooks and tickets.

Mautic authentication docs

Restrict edit rights on IP lookup

Changing the IP lookup service or its credentials affects every visitor record that Mautic enriches with location. Limit the permission to edit these settings to a small named group of administrators, and confirm in your installed version which Mautic user role grants access to the configuration screen. Review that group when people change roles or leave the team.

Restrict outbound access from the server

The Mautic server only needs to reach MaxMind's download endpoints to fetch GeoIP databases, so allow outbound traffic to those endpoints and deny other egress from the web and worker hosts where possible. Confirm the current hostnames with MaxMind before writing firewall rules, since they can change. Test the download from the production network after each rule change so scheduled updates do not fail silently.

Log configuration changes

Record who changed the AccountID, the LicenseKey or the lookup settings, and when. Mautic's own audit records and your server or configuration management logs may cover this differently, so confirm what your version captures. Forward these logs to the same central store you use for other administrative actions so a changed credential can be traced during an incident.

Rotate the license key on schedule

Rotate the MaxMind LicenseKey according to your organization's secrets policy, and treat any suspected exposure as a reason to rotate immediately. Plan each rotation as a short change: generate the new key in your MaxMind account, update the configuration, run a manual database download and then revoke the old key. Ask your secrets team whether the key belongs in your vault and how the update is recorded.

Why GeoIP lookups return empty or stale locations

This table compares six common causes of empty or stale visitor locations in Mautic, with the cause and a check the team can run for each. Work through the rows in order, since credential and download problems hide the effects of later causes. The main takeaway is that most empty results come from configuration, scheduling or network path issues rather than from the lookup itself.

FailureLikely causeCheck to run
Lookup returns no location at allAccountID and license key entered in the wrong format or with stray spacesConfirm the GeoIP field holds AccountID:LicenseKey as one string, with no spaces or line breaks, and that the account ID is the numeric value shown in your MaxMind account
Lookup fails after it previously workedLicense key expired, rotated or copied from an old accountLog in to your MaxMind account, confirm the key is active, generate a new one if needed and update the Mautic configuration
Database file is missing or never updatedOutbound access from the server to MaxMind download hosts is blocked by firewall or egress rulesFrom the Mautic server, test an outbound HTTPS request to the MaxMind download endpoint, then check that the GeoIP database file exists in the expected Mautic path with a recent modified date
Locations are never refreshedCron jobs that trigger the database update are not running, or run as a user without write accessReview the crontab for the web user, check the Mautic logs for the update attempt, and confirm the database file's modified date changes after the scheduled run
Every visitor shows the same locationA reverse proxy or load balancer forwards its own address, so Mautic records the proxy as the visitor IPCompare the IP Mautic logs for a test visit with your public IP, then confirm the proxy passes the client address in forwarding headers and that Mautic trusts that proxy
Lookups are unreliable or the database is absent after upgradesShared hosting, which the Mautic project does not recommend for installationCheck the hosting plan for shell access, cron control, file write permissions and PHP settings, and move Mautic to a VPS or dedicated server if any are missing

Questions buyers ask before setting up MaxMind GeoIP in Mautic

What does a MaxMind GeoIP setup in Mautic cost?

The cost is mostly internal and advisory time, not software licensing. Mautic itself is free open-source software, but MaxMind account terms and any fees are set by MaxMind, so confirm the license terms directly with them before you plan the budget. The main cost components are the admin time to configure the AccountID:LicenseKey credentials and cron-driven database updates, server access, testing of lookups against known IP addresses, and a privacy or legal review of the location data. Setup work is one-time, while database maintenance, account administration and periodic privacy review recur. Costs rise with the number of websites, the number of segments and content blocks that depend on location, and the number of reviewers. When requesting a quote, ask for an itemized scope, the roles and hours assumed, what is excluded, and who holds the MaxMind account.

How long does a MaxMind GeoIP setup in Mautic take?

The duration depends on how quickly the required inputs and approvals arrive, and no fixed timeline applies to every instance. The configuration itself is usually short, but the schedule grows when the MaxMind account is not yet set up, when server access needs a change request, or when privacy reviewers need to approve how location data feeds segments and content. Testing adds time when many segments or dynamic content slots depend on location. Your Mautic cron jobs must also run reliably so the database updates, and the cron documentation advises staggering those jobs, which can require a change to your server schedule. Ask for a written timeline that lists each dependency, the owner of each dependency, and the approval points, so the schedule reflects your environment rather than a generic estimate.

What must our team provide before a GeoIP setup starts?

Four inputs unblock most GeoIP work, and each one should have a named owner before the work begins:

  • Server access to the Mautic host, including the ability to edit the cron schedule and confirm the PHP and web server settings.
  • A MaxMind account owner who can create or manage the license key and accept the account terms on behalf of your organization.
  • Privacy and legal sign-off on how city-level location is collected, stored, purged and used in marketing.
  • A list of the segments, campaigns, dynamic content and focus items that will use location, with the expected outcome for each.

The list matters most, because it defines what needs testing. Without it, the team cannot tell which visitor experiences change or which records a purge would affect. Confirm also which Mautic release your instance runs, since that determines the supported settings and the upgrade path.

Can an internal Mautic admin set up GeoIP alone?

An experienced internal admin can often complete the configuration alone, provided the prerequisites are in place. The work involves entering the MaxMind credentials in the expected AccountID:LicenseKey format, confirming that automatic database downloads succeed, and checking that location appears on test contacts. Before starting, confirm four things: that your Mautic instance is on a supported release line, that you have shell or scheduler access to the cron jobs, that the MaxMind account is owned by someone who can maintain it, and that privacy sign-off covers location data. Solo work becomes risky when the admin also owns the server, the privacy review and the segment design, because a single person then carries every approval and test. A partner can take on part of that scope under a written agreement, and DeployOpen delivers fixed-scope engagements agreed in writing before work starts.

How should the CCPA purge be configured and reviewed?

Configure the CCPA purge as a documented privacy setting, not an informal cleanup job, and confirm its exact behavior against the Mautic documentation for your release before you enable it. Your privacy or legal team should decide the retention approach and what counts as a purge trigger, because those decisions determine the setting values. Test the purge with sample contacts that you control, then record the test steps, the expected result and the actual result as evidence. Review the setting on a schedule and again after every Mautic upgrade or MaxMind database change, since either can alter behavior. Assign an owner who can explain the configuration to an auditor or a regulator. Keep in mind that the purge affects location data only, so review whether other personal data in the same contact records needs a separate retention rule.

What is city-level location used for in Mautic?

City-level location gives Mautic a coarse geographic attribute that can feed segment filters, campaign conditions and dynamic web content. Teams commonly use it to show region-specific offers, route a visitor to the right language or regional page, or build a segment for a local event. It is an estimate derived from an IP address, so it can be wrong, especially for mobile networks, VPNs and corporate proxies. Design every use so that a wrong guess causes little harm, and avoid decisions with legal or financial effect based on location alone. Before you enable it, map each use to the consent notice and the lawful basis your privacy team has documented, and confirm that the data is handled as your policy requires. The segment and content list from your planning session should show exactly where location is used.

What usually breaks in a Mautic GeoIP setup?

Most failures fall into a short list of checks that you can run after setup and after each upgrade:

  • Credentials entered in the wrong format or with a stray space, so the database never downloads.
  • Cron jobs not running on schedule, which leaves the database stale or stops segment and campaign updates. The cron documentation expects these jobs to be staggered.
  • Hosting that does not match Mautic's requirements, since the project advises against shared hosting.
  • A reverse proxy or load balancer that passes the wrong client IP address, so every visitor appears to come from the same place.
  • Test traffic from office or monitoring IP addresses that skews results.

Check each item against a known test IP and a sample contact, and log the results so the next person can repeat the check.

How DeployOpen scopes and delivers Mautic location setup

DeployOpen scopes Mautic location setup from your privacy requirements, your Mautic version and the infrastructure that will hold the MaxMind credentials and databases. The work is delivered as a fixed-scope engagement with written deliverables, and each step is documented so your compliance and platform teams can review it. Ongoing support and upgrades can follow as a retainer.

How we scope

  • The written scope names the Mautic instance, the MaxMind product and the accounts that will hold the license.
  • We confirm which pages and regions need city-level data, so purge rules match your privacy notice.
  • Scope lists the Mautic version and hosting checks needed before the lookup feature is configured.

How we build

  • We store the AccountID:LicenseKey value in a secrets store and reference it from configuration, never in plain files.
  • We schedule automatic database downloads and check they run alongside Mautic's staggered cron jobs.
  • We test lookups from sample visitor sessions and confirm the city-level fields that reach contact records.

How we hand over

  • Handover includes a runbook covering credential rotation, database update checks and where lookup data is stored.
  • You receive written configuration records, the purge procedure and test results for your compliance reviewers.
  • Your team gets a walkthrough of the settings so administrators can review and change them later.

How we support

  • Retainers can cover Mautic upgrades, MaxMind account changes and periodic checks of the purge settings.
  • Support can include retesting lookups after each Mautic release on the supported line you run.
  • Ask any provider to confirm how credential changes and database updates are logged and reviewed.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.