{"id":18328098,"url":"https://github.com/wpengine/geoip","last_synced_at":"2025-04-07T19:16:49.816Z","repository":{"id":20820393,"uuid":"24106163","full_name":"wpengine/geoip","owner":"wpengine","description":"WordPress Plugin: WP Engine GeoTarget","archived":false,"fork":false,"pushed_at":"2025-02-03T11:48:02.000Z","size":685,"stargazers_count":52,"open_issues_count":7,"forks_count":20,"subscribers_count":115,"default_branch":"master","last_synced_at":"2025-03-31T17:17:12.077Z","etag":null,"topics":["php","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"https://wordpress.org/plugins/wpengine-geoip/","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wpengine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-16T15:47:19.000Z","updated_at":"2025-03-17T21:55:04.000Z","dependencies_parsed_at":"2025-01-15T21:10:39.363Z","dependency_job_id":"d24c72ae-a81f-494a-a856-932b5b5ae87f","html_url":"https://github.com/wpengine/geoip","commit_stats":{"total_commits":131,"total_committers":16,"mean_commits":8.1875,"dds":0.7099236641221374,"last_synced_commit":"59c65881500d1022a1318df944486452ca7f4c7c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpengine%2Fgeoip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpengine%2Fgeoip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpengine%2Fgeoip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wpengine%2Fgeoip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wpengine","download_url":"https://codeload.github.com/wpengine/geoip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","wordpress","wordpress-plugin"],"created_at":"2024-11-05T19:13:07.811Z","updated_at":"2025-04-07T19:16:49.787Z","avatar_url":"https://github.com/wpengine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP Engine GeoTarget\n[![Build Status](https://travis-ci.org/wpengine/geoip.svg?branch=master)](https://travis-ci.org/wpengine/geoip) [![codecov](https://codecov.io/gh/wpengine/geoip/branch/master/graph/badge.svg)](https://codecov.io/gh/wpengine/geoip)\n\nWP Engine GeoTarget integrates with the variables on your WP Engine site to display content catered to the visitor’s location. With the ability to access variables from as broad as country to as specific as latitude and longitude, your website can now display geographically relevant content.\n\n## Use cases\n\n### Geo-Marketing\n\n* Create marketing campaigns targeted only at certain locations.\n\n### Localization\n\n* Redirect incoming traffic to content in the local language or currency.\n* Businesses with local branches can direct customers to a relevant physical location or local microsite.\n\n### Ecommerce\n\n* Filter out merchandise or services that are not available in a certain locale.\n* Display country-specific shipping, tax, or sales information.\n\n### Legal Requirements\n\n* Filter required legal notices from countries for whom those notices may not be relevant.\n\n### * Please Note *\n\nIf you are signed into a Premium or Enterprise plan, you can use this plugin at no additional cost. If you are on another plan type and would like to use GeoTarget on one of your sites, you can add it to your plan [here](http://wpengine.com/plans/?utm_source=wpengine-geoip). This will not function outside of the WP Engine environment.\n\n## Installation\n\n1. Upload `wpengine-geoip` to the `/wp-content/plugins/` directory\n2. Activate the plugin through the 'Plugins' menu in WordPress\n\n## How to use\n\n### Location Variable Shortcodes\n\nYou can use any of the following location variable shortcodes to return the various geographic location the user is visiting your site from:\n\n1. Continent: `[geoip-continent]`\n\n2. Country: `[geoip-country]`\n\n3. Region: `[geoip-region]`\n  * In the US region will return States\n  * In Canada region will return Provinces\n  * Outside the US/CA this will return a Region number. Please note region numbers are not unique between countries\n\n4. City: `[geoip-city]`\n\n5. Postal Code: `[geoip-postalcode]`\n  * This variable is only available in the US due to limitations with the location data GeoTarget uses\n\n6. Latitude: `[geoip-latitude]`\n\n7. Longitude: `[geoip-longitude]`\n\n8. Location: `[geoip-location]`\n\n#### Example\n\n**In your post editor:**\n\n\u003e Hi, and welcome to [geoip-city]! The place to be in [geoip-region],[geoip-country].\n\n**A visitor from Austin, Texas would see:**\n\n\u003e Hi, and welcome to Austin! The place to be in TX, US.\n\n### Localized Content\n\nThe content shortcode allows you to hide or show specific content based on visitor geographies:\n\n\u003e [geoip-content country=\"US\"]Your US specific content goes here[/geoip-content]\n\nBelow are all the supported geography options, this allows to you SHOW content for only specific locations:\n\n* continent\n* country\n* areacode\n* region\n* city\n* postalcode\n\nBelow are all the supported negative geography options, this allows to you HIDE content for only specific locations:\n\n* not_continent\n* not_country\n* not_areacode\n* not_region\n* not_city\n* not_postalcode\n\n#### Examples of the Content Shortcode\n\nThis will display “Content just for US visitors” strictly for visitors viewing from the United States.\n\n\u003e [geoip-content country=\"US\"] Content just for US visitors [/geoip-content]\n\nThis will display “Content just for everyone in Texas and California” strictly for visitors from Texas and California.\n\n\u003e [geoip-content region=\"TX, CA.\"] Content just for everyone in Texas and California [/geoip-content]\n\nYou can mix and match geography and negative geography options to create verbose logic in a single shortcode:\n\n\u003e [geoip-content country=\"US\" not_city=\"Austin\"]Content for US visitors but not for visitors in Austin[/geoip-content]\n\n#### Limitation\n\nThere is a limitation in the logic that lets you filter content for multiple geographic areas.\n\nYou can progressively limit the area that content is shown in. But once your content is hidden from an area, a subset of that area can't be added back in.\n\nFor example,\nIf I localize content so that it shows to all of Europe, then prevent my content from showing in Great Britain, I can't go back and show it to London.\n\n#### Creative Work Arounds\n\nLimit content to some regions of a country (or some cities of a state)\n\n##### Example 1\n\nYou want to show an offer for free shipping to every state in the US *but* Alaska and Hawaii. You may be inclined to write something like\n\n*Instead of:*\n\n\u003e [geoip-content country=\"US\" not_state=\"AK, HI\"]Lorem ipsum dolor sit amet[/geoip-content]\n\n*Show it to all 48 states:*\n\n\u003e [geoip-content state=\"AL, AZ, AR, CA, CO, CT, DE, FL, GA, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY\"]Free shipping on all orders over $50![/geoip-content]\n\n##### Example 2\n\nYou want to show discount airfare on a flight to Paris, France. The content should show to all of the US and France, but not Paris itself.\n\n*Instead of:*\n\n\u003e [geoip-content country=\"US, FR\" not_city=\"Paris\"]Fly to Paris for only $199![/geoip-content]\n\nThe problem here is that Paris, Texas will be hidden. The solution?\n\n*Just have two geoip-content shortcodes:*\n\n\u003e [geoip-content country=\"FR\" not_city=\"Paris\"]Fly to Paris for only $199![/geoip-content]\n\u003e [geoip-content country=\"US\"]Fly to Paris for only $199![/geoip-content]\n\n##### Example 3\n\nYou want to show an ad written in Spanish to all of South America except for Brazil. Brasilia, however, has enough Spanish speakers that you want to include Brasilia.\n\n*Instead of:*\n\n\u003e [geoip-content continent=\"SA\" not_country=\"BR\" city=\"Brasilia\"]Lorem ipsum dolor sit amet[/geoip-content]\n\n*Just have two geoip-content shortcodes:*\n\n\u003e [geoip-content continent=\"SA\" not_country=\"BR\"]Venta de la Navidad en los adaptadores USB[/geoip-content]\n\u003e [geoip-content city=\"Brasilia\"]Venta de la Navidad en los adaptadores USB[/geoip-content]\n\n## Additional features\n\n### Calculate distance between points\n\nYou have a utility function that will calculate the distance from your provided lat/long coordinate to the visitor's location in either miles or kilometers. This can be useful for determining approximate distances, as results may be cached at the state or country level, depending on your configuration.\n\n#### Example\n\n```php\n$latitude  = 30.268246;\n$longitude = -97.745992;\n$geo = WPEngine\\GeoIp::instance();\nif ( false !== $geo-\u003edistance_to( $latitude, $longitude ) ) {\n    $miles_to_wp_engine = $geo-\u003edistance_to( $latitude, $longitude );\n}\n```\n\n### Test pages from other locations\n\nYou can use the following URL parameters to test how your localized content will appear to visitors from various geographic locations. You can add any of the parameters below to any URL of a page using the GeoTarget shortcodes or API calls:\n\n#### Examples\n\nSpoof visitor from the state of Texas:\n\n```http\nhttps://yourdomain.com/?geoip\u0026region=TX\n```\n\nSpoof visitor from the United States:\n\n```http\nyourdomain.com/?geoip\u0026country=US\n```\n\nSpoof visitor from Austin, Texas\n\n```http\nyourdomain.com/?geoip\u0026city=Austin\n```\n\nSpoof visitor from the U.S. zip code 78701:\n\n```http\nyourdomain.com/?geoip\u0026zip=78701\n```\n\n## Frequently Asked Questions\n\n1. Will this work outside of the WP Engine hosting account?\n\n    \u003e No, this will only work within the WP Engine environment. This will not work for sites hosted on other web hosts.\n\n2. Are there any other restrictions to using this plugin?\n\n    \u003e Yes. If you are signed into a Premium or Enterprise plan, you can use this plugin at no additional cost. If you are on another plan type and would like to use GeoTarget on one of your sites, you can add it to your plan [here](http://wpengine.com/plans/?utm_source=wpengine-geoip). For all plan types, just reach out to the [Support Team](https://my.wpengine.com/support) to enable GeoTarget for your site.\n    \u003e You can read our full GeoTarget activation guide [here](https://wpengine.com/support/geoip-personalizing-content-based-geography/).\n\n3. What variables do I have access to?\n\n    \u003e Continent, country, state, city, zip, latitude, longitude.\n\n4. How do I sign up for a WP Engine Account?:\n\n    \u003e That’s easy! [Signup here](http://wpengine.com/plans/?utm_source=wpengine-geoip).\n\n5. I installed the plugin and used a shortcode or API call and it isn’t working.\n\n    \u003e Please contact the WP Engine [Support Team](https://my.wpengine.com/support).\n\n## Contributing\n\nRunning `make` from the repository root will download dependencies, lint, and test the plugin. `make build` will package the plugin as a zip and place it in the `/build` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpengine%2Fgeoip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwpengine%2Fgeoip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwpengine%2Fgeoip/lists"}