Title: Triggering GeoIP collection programmatically
Last modified: April 10, 2025

---

# Triggering GeoIP collection programmatically

 *  Resolved [motivmedia](https://wordpress.org/support/users/motivmedia/)
 * (@motivmedia)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/triggering-geoip-collection-programmatically/)
 * Almost a year ago I asked how I can initiate the GEoIP download programmatically(
   [https://wordpress.org/support/topic/activating-geoip-collection-programmatically/#post-17752632](https://wordpress.org/support/topic/activating-geoip-collection-programmatically/#post-17752632)).
   I was given the following, which worked:
   `\WP_STATISTICS\GeoIP::download('country',"
   update");`
 * Using this now gives me an error and tells me to use the following instead:
   `
   GeolocationFactory::downloadDatabase()`
 * Which I had assumed to be needed to be adapted in the same manner to:
   `\WP_STATISTICS\
   GeolocationFactory::downloadDatabase('country', "update");`
 * Alas, that only results in a fatal error. I feel it’s better to just ask again
   than to dig around myself. To be clear, I know why this has changed, I’m just
   not sure to what exactly.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * (@mostafas1990)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/triggering-geoip-collection-programmatically/#post-18410989)
 * Hi, thanks for getting back.
 * Simply calling `GeolocationFactory::downloadDatabase()` should work fine.
 * Ensure your internet connection is stable and confirm your Geolocation settings
   set **Geolocation Database Update Source** to **“Use the JsDelivr”**.
 * Also, please provide the exact fatal error message you’re seeing; it’ll help 
   us identify the issue faster.
 * Cheers

Viewing 1 replies (of 1 total)

The topic ‘Triggering GeoIP collection programmatically’ is closed to new replies.

 * ![](https://ps.w.org/wp-statistics/assets/icon.svg?rev=3081064)
 * [WP Statistics – Simple, privacy-friendly Google Analytics alternative](https://wordpress.org/plugins/wp-statistics/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-statistics/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-statistics/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-statistics/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-statistics/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-statistics/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mostafa Soufi](https://wordpress.org/support/users/mostafas1990/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/triggering-geoip-collection-programmatically/#post-18410989)
 * Status: resolved