{"id":770,"date":"2016-02-05T01:02:03","date_gmt":"2016-02-05T09:02:03","guid":{"rendered":"https:\/\/cloudinsidr.com\/content\/?p=770"},"modified":"2016-03-22T14:16:15","modified_gmt":"2016-03-22T22:16:15","slug":"how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts","status":"publish","type":"post","link":"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/","title":{"rendered":"How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side\u00a0Scripts"},"content":{"rendered":"<p>The Amazon Link plug-in for WordPress implements geotargeting based on ip2nation, a free geotargeting library from Per Gustafsson Consulting (available <a href=\"http:\/\/www.ip2nation.com\/\" target=\"_blank\">here<\/a>). If you are wondering what you need to do in order to integrate the <strong>Amazon Link<\/strong> affiliate plug-in for WordPress (seing how a separate installation plugin for WordPress is two years old as of this writing, and counting), here is a quick howto for those who can access their websites&#8217; <strong>MySQL or MariaDB<\/strong> database servers.<\/p>\n<p><!--more--><\/p>\n<p><a href=\"https:\/\/cloudinsidr.com\/content\/wp-content\/uploads\/2016\/02\/dgt_header.png\" rel=\"attachment wp-att-772\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-772\" src=\"https:\/\/cloudinsidr.com\/content\/wp-content\/uploads\/2016\/02\/dgt_header.png\" alt=\"dgt_header\" width=\"582\" height=\"320\" srcset=\"https:\/\/www.cloudinsidr.com\/content\/wp-content\/uploads\/2016\/02\/dgt_header.png 582w, https:\/\/www.cloudinsidr.com\/content\/wp-content\/uploads\/2016\/02\/dgt_header-300x165.png 300w\" sizes=\"(max-width: 582px) 100vw, 582px\" \/><\/a><\/p>\n<h5>Step 1. Download the mysql file<\/h5>\n<p>Ssh to the server which is running your database (if this is not possible, see below for an alternative).<\/p>\n<p>Download the database table into some temporary directory:<\/p>\n<pre>wget http:\/\/www.ip2nation.com\/ip2nation.zip<\/pre>\n<p>and unzip it:<\/p>\n<pre>unzip ip2nation.zip<\/pre>\n<p>(If you cannot ssh to the server for lack of shell access,\u00a0download the file to your local computer, unzip it locally, edit it as described in Step 5, then upload it to the server using the alternative method and you should be good.)<\/p>\n<h5>Step 2. Backup your databases (&#8217;cause you never know!)<\/h5>\n<p>Backup your databases:<\/p>\n<pre>mysqldump -u root -p --opt --alldatabases &gt; dumpfile.mysql;<\/pre>\n<p>Should you later need to load the dump file (the backup file) in order to restore your databases, here is the command you would want to use at that time\u00a0(not now!):<\/p>\n<pre>mysql &lt; dumpfile.sql;<\/pre>\n<h5>Step 3. Connect to your database server<\/h5>\n<p>Connect to your database server:<\/p>\n<pre>mysql -u root -p\r\nenteryourpassword<\/pre>\n<h5>Step 4. Figure out which database holds your WordPress data<\/h5>\n<p>List available databases:<\/p>\n<pre>show databases;<\/pre>\n<p>and make a note of their\u00a0names. If looking at this output does not provide sufficient clues as to which database is storing what, check the config file of your CMS system that holds database access information (wp-config.php for WordPress).<\/p>\n<h5>Step 5. Make sure MySQL\/MariaDB gets to know which database to write to<\/h5>\n<p>Open the file ip2nation in a text editor of your choice. On the first line, enter the command you would normally use to tell the database server which database (dbname) to write to (or which database to read from):<\/p>\n<pre>USE dbname;<\/pre>\n<p>Replace dbname with the actual name of yoru database, save the file and exit the editor.<\/p>\n<h5>Step 6. Import the file into the database<\/h5>\n<p>Import the contents of the file into the database:<\/p>\n<pre>mysql -u root -p --verbose &lt; ip2nation-website1.sql;\r\nenteryourpassword<\/pre>\n<h5>Step 7. Verify that the integration was\u00a0successful<\/h5>\n<p>On the Settings page of the plugin, you will see:<br \/>\n&#8220;Your ip2nation database is up to date&#8221;. Activate the option next to it and save. Your configuration should be ready to go.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Amazon Link plug-in for WordPress implements geotargeting based on ip2nation, a free geotargeting library from Per Gustafsson Consulting (available here). If you are wondering what you need to do in order to integrate the Amazon Link affiliate plug-in for WordPress (seing how a separate installation plugin for WordPress is two years old as of [&hellip;]<\/p>\n","protected":false},"author":101011,"featured_media":772,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1,6],"tags":[106,105,103,107,81,82,100,84],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v14.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side\u00a0Scripts - CloudInsidr<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side\u00a0Scripts - CloudInsidr\" \/>\n<meta property=\"og:description\" content=\"The Amazon Link plug-in for WordPress implements geotargeting based on ip2nation, a free geotargeting library from Per Gustafsson Consulting (available here). If you are wondering what you need to do in order to integrate the Amazon Link affiliate plug-in for WordPress (seing how a separate installation plugin for WordPress is two years old as of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"CloudInsidr\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-05T09:02:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-22T22:16:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cloudinsidr.com\/content\/wp-content\/uploads\/2016\/02\/dgt_header.png\" \/>\n\t<meta property=\"og:image:width\" content=\"582\" \/>\n\t<meta property=\"og:image:height\" content=\"320\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#website\",\"url\":\"https:\/\/www.cloudinsidr.com\/content\/\",\"name\":\"CloudInsidr\",\"description\":\"Cyber security, infotech\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.cloudinsidr.com\/content\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.cloudinsidr.com\/content\/wp-content\/uploads\/2016\/02\/dgt_header.png\",\"width\":582,\"height\":320},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/#webpage\",\"url\":\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/\",\"name\":\"How to Set up ip2nation: Geotargeting Made Easy for the Amazon Link Affiliate Plug-in and Your Server-Side\\u00a0Scripts - CloudInsidr\",\"isPartOf\":{\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/#primaryimage\"},\"datePublished\":\"2016-02-05T09:02:03+00:00\",\"dateModified\":\"2016-03-22T22:16:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#\/schema\/person\/21ce63bea726ea64da1beed97e63ba84\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.cloudinsidr.com\/content\/how-to-set-up-ip2nation-geotargeting-made-easy-for-the-amazon-link-affiliate-plug-in-and-your-server-side-scripts\/\"]}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#\/schema\/person\/21ce63bea726ea64da1beed97e63ba84\",\"name\":\"Anna E Kobylinska\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.cloudinsidr.com\/content\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7a3e9bd152f9d5cd41bf2b92df649857?s=96&d=mm&r=g\",\"caption\":\"Anna E Kobylinska\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts\/770"}],"collection":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/users\/101011"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/comments?post=770"}],"version-history":[{"count":10,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts\/770\/revisions"}],"predecessor-version":[{"id":782,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/posts\/770\/revisions\/782"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/media\/772"}],"wp:attachment":[{"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/media?parent=770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/categories?post=770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cloudinsidr.com\/content\/wp-json\/wp\/v2\/tags?post=770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}