how to change a link on different countries on rails - ruby-on-rails

Is it possible to change the address of a link on different countries?
I am creating a website for a non-profit, and the donations are made through another website(classy).
I have two pages in Classy, one for United States, and one for Canada and the user needs to choose one link to click.
I would like to make the link change automatically if the user is either in US or Canada. Is it possible?
When can I find more information about it?

You should use some functionality which is able to recognize country from IP address, for example geoip gem and then make condition which link should be displayed

Related

Making Google direct users to region-specific website or subdomain

I have a good, short website name like mysite.fr.
It's a website for my real shop (not an online shop).
I have 2 shops. These shops are located in 2 different cities, relatively far away from each other.
I could
1) make one website with 2 subdomains like
paris.mysite.fr
marseille.mysite.fr
2) make 2 new domains like
mysite-paris.fr
mysite-marseille.fr
But that would mean that I can't use my great, short URL anymore.
If option 1 is preferred, I would like to ask how I could properly teach Google what to show each Google Search user. I think it's contraproductive if I have to ask the user to choose the correct city to get to the appropriate shop.
I know that this is possible when using Google Ad campaigns, but I don't know of a way to do that for the common Google search.
Or is option 2 preferred anyways because option 1 is too error-prone?
Thank you.
There are many solutions you could use from the top of my mind I'm thinking about this flow.
First you need the user address:
Could be based on user input (asking for his address) in a text box like the typical food delivery landing page
Could be based on some "plugin" like google maps geolocation that tells you which is the place he is connecting from (usually it tells you street and such)
Then you need to basically locate to which store he is closer to
Then you need to decide which URL solution to use.
[Proposal] You could also move it to mysite.fr/paris or mysite.fr/marseille (sometimes this is better seo speaking, and also simpler when it comes to management) and you keep that amazing site name as the main protagonist as you were stating
Then you need to basically redirect him to the page to the store he was closer to.
In any case, I've been working in several sites that had that "change items based on address logic" and you can PM me for more info :)
Also there are ways in google Adwords in which you can basically put an advertisement only for certain keywords, regions and such, and in that case that is the option you are looking for. You should just create 2 rules, (one per region) and basically just display the adds to the people that are inside the area. This is an example of how the configuration you should put looks like in google Adwords. (It's really simple)
And this is how the add would look like in the google search or other channels depending on the target you select
See my LinkedIn if you want to contact me https://www.linkedin.com/in/alejandro-vales/
I would suggest the first way you mentioned and I guess you could use Radius around a location in Google Ads:
Radius targeting (also known as proximity targeting or "Target a radius") allows you to choose to show your ads to customers within a certain distance from your business, rather than choosing individual cities, regions, or countries.
Selecting a radius
When you target a radius, it's worth keeping in mind that selecting a small radius could mean that your ads might only show intermittently or not at all. That’s because small targets might not meet our targeting criteria.
From the page menu on the left, click Locations.
Click the name of the campaign you wish to edit.
Click the blue pencil icon, then select Radius.
In the search box, enter the address of the location you'd like to use for the center of the radius. Enter the radius that you'd like to target and select a unit of measurement from the drop-down menu.
Check the map to make sure you're targeting the correct area. When you're ready, click Save to add the radius target.
Click Save.
The documentation can be found here.
A Complete tutorial :The Complete Guide to AdWords Location Targeting.

Product Price based on currency in Magento

I need to set multiple product price for products in Magento based on currency.
I know that this can be done by creating multiple websites, but doing so only for a price attribute doesn't seem reasonable as everything expect that remains the same. Will also be problematic in terms of SEO.
Also came through an extension : http://www.magentocommerce.com/magento-connect/currency-pricing.html, but doesn't looks promising based on the reviews.
Please share our suggestions on how this can be achieved without multiple website setup.
You can use the Auto Currency Switcher for this here is the link
This extension uses the IP address of the country and display the currency according to the IP address. You just have to set up the Magento Cron to updated the currency and it will show the updated price of the products according to the country.
I think there is no need to create the multiple stores.
Hope it helps.
Thanks,

ios google api issue

I need to add a very common Google functionality to an iPhone app I am developing. The idea is that the user is presented with a TextBox where he can write an address (i.e.: "Amsterdam av)". The thing is that I want to add some "help" for him, se when he writes a street name, the app will show him a list of partial matches, like google Maps does here:
sample http://www.timotteo.com.ar/google.png
I can´t find the exact class in the google API. It doesn't need to be as fast as google's own search, maybe the user can write "amst" and press a search button, to be presented with a list of partial matches. The API I'm looking for show return in some way a list with posibilities. All I could find for now where method that gives you the lat/long when you feed it with a specific address. Does somebody know what combination of methods/classes I should use? Maybe some example?
Txs in advance!
Perhaps you are looking for the autocomplete feature of the Places API:
https://developers.google.com/maps/documentation/javascript/places#places_autocomplete
This won't autocomplete for all addresses or streets, but rather for businesses, notable landmarks, etc.
If you want autocomplete for street addresses, I do not believe that is available through any documented APIs. That doesn't mean workarounds don't exist, but they may depend on more details about your use case. (For example, if you only care about a narrow geographic area, it may be possible to simply have a list of all the streets in your own database and handle the AJAX call yourself.)
Actully what I was looking for is this:
http://maps.google.com/maps/geo?q=amsterdam%201543&output=xml&oe=utf8&sensor=true&hl=es&gl=ar
That URL returns and XML with all the autocomplete options. All I have to do is parse that XML and voila! There I have my list.

Display content based on location

How do I go about displaying content based on a users location ? For ex. If somebody accesses the site from the New York , I would like to display New York Hotels . However if somebody accesses the site from Chicago , I would like to display Chicago hotels.
You're looking for a Geoloction database which would give you access to the typical IP ranges for the countries/cities you need to flag.
This is not absolute or completely trustworthy information though. Country level geo-location is mostly effective but anything like city/state/zip code level information should be treated with great caution.
I've worked with major multinational media providers using expensive paid services and discovered that the information in these databases is a very long way from correct and that users individual circumstances often prevent geo-location from being effective.
e.g. Virgin and East Coast trains in the UK use T-Mobile Germany as their onboard internet provider so you appear to be in Germany to many sites and payment processors.
There are quite a few free geolocation databases, MaxMind springs to mind (though this is not a recommendation of their service).
You can find some thoughts on implementing geo-location here
You need some database/api with information about hotells in different locations, then you need to now where the visitor is.
You can use something like Travel/Hotel API's? to find hotells.
And for finding the location of your visitor you can use something like http://www.hostip.info/use.html
or you can use HTML5 geolocation api example http://html5demos.com/geo . The bad thing with the html5 geo api is that the user need to accept before you get their location.
Remember that there is no guaranty that the location is correct...
This is the exact reason I created wpgeocode. WPGeocode is a free plugin for wordpress that enables publishers to customize content based on reader location. Check out the plugin at the support site at http://www.wpgeocode.com
The plugin enables shortcodes that can be placed in your posts or pages. There are many conditional shortcodes such as [wpgc_is_country_code country_code="US"] for this exact purpose. Simple open the shortcode, specify the target country_code and provide the content to be displayed if the reader is visiting from that specific country.
Visit http://www.wpgeocode.com/shortcodes for a complete listing - here are a few:
[wpgc_is_city_and_state city=”Yardley” state_code=”PA”]
[wpgc_is_ip” ip=”xx.xx.xx.xx”]
[wpgc_is_ips” ip=”xx.xx.xx.xx,aa.bb.cc.dd”]
[wpgc_is_not_ip” ip=”xx.xx.xx.xx”]
[wpgc_is_not_ips” ip=”xx.xx.xx.xx,aa.bb.cc.dd”]
[wpgc_is_city” city=””]
[wpgc_is_cities” cities=”city one,city two,city three”]
[wpgc_is_not_city” city=””]
[wpgc_is_not_cities” cities=”city
one,city two,city three”]
[wpgc_is_nearby”] – Uses the value you
specify in the Nearby Range setting from the administrative panel
[wpgc_is_not_nearby”]
[wpgc_is_within” miles=”10″]
[wpgc_is_within
kilometers=”12″]
[wpgc_is_country_name” country_name=””]
[wpgc_is_country_names” country_name=”United States,Egypt,Albania”]
[wpgc_is_country_code” country_code=””]
[wpgc_is_country_codes”
country_codes=”US,GB,AZ”]
[wpgc_is_state_code” state_code=””]
[wpgc_is_state_codes” state_codes=”PA,NJ,TX”]
[wpgc_is_not_country_name” country_name=””]
[wpgc_is_not_country_names” country_names=”United
States,Egypt,Albania”]
[wpgc_is_not_country_code” country_code=””]
[wpgc_is_not_country_codes” country_codes=”US,GB,AZ”]
[wpgc_is_not_state_code” state_code=””]
[wpgc_is_not_state_codes”
state_codes=”PA,NJ,TX”]
dotCMS offers the ability to geolocate content OTB (disclaimer, I work for them). You can see a demonstration that displays news content based on the user's location onthe demo site:
It is pretty easy to setup and use. Any type of content can be geolocated and the content can be accessed through the RESTful API. Under the covers, the Geolocation queries are handled natively via Elasticsearch.
Example:
http://demo.dotcms.com/demos/content-geolocation
Docs:
http://dotcms.com/docs/latest/es-geolocation-queries

How do you get google to show the correct country domain as per their recomendation?

We have a site that serves up the same content but on country specific domains - so a potential duplicate content issue.
After doing some research, we went with Google's recommendation of using country specific domains instead of www.domain.com/country-directory/
However, when you search from another country, the correct domain does not appear. We have a person in Australia and every time they search google, the .com.au domain doesn't show up.
We have both country domains setup in Google's Webmaster's tools and both have country specific sitemap.xml files which Webmaster tools has no issue with seeing - in fact, there are no errors of any kind (crawl errors etc) as far as Webmaster tools is concerned.
Does anyone know what we might be doing wrong?
Make sure your australian friend is using http://google.com.au. You can conduct the search yourself on their to check if it is working or not, you do not need someone in another country to do so.

Resources