Help - Search - Members - Calendar
Full Version: Geotargetting
World Dating Partners Forum > Support > Can anyone help?
godfly
www.sweetsavior.com - country defaults to UK.

I'm located in Canada.

My code looks like this

<select name="seekingCountryId" id="seekingCountryId" class="formSelect" style="width:120px">


<option value="0" >All countries</option>

<option value="203" selected="selected">United Kingdom</option>

<option value="13" >Australia</option>

<option value="14" >Austria</option>

** I don't want to have any "selected" country. I would like to show the country based on where the user is located. How do I fix this?

The tips says "You can use {%GEO_COUNTRY%} {%GEO_REGION%} {%GEO_CITY%} macroses to add geotargeting " but I don't know how to use it.
nurijk
QUOTE(godfly @ Mar 2 2009, 03:31 AM) *
www.sweetsavior.com - country defaults to UK.

I'm located in Canada.

My code looks like this

<select name="seekingCountryId" id="seekingCountryId" class="formSelect" style="width:120px">


<option value="0" >All countries</option>

<option value="203" selected="selected">United Kingdom</option>

<option value="13" >Australia</option>

<option value="14" >Austria</option>

** I don't want to have any "selected" country. I would like to show the country based on where the user is located. How do I fix this?

The tips says "You can use {%GEO_COUNTRY%} {%GEO_REGION%} {%GEO_CITY%} macroses to add geotargeting " but I don't know how to use it.

If you want the default country to be Canada just change the selected="selected" part. Remove this bit from the UK and add it to Canada. Now the dropdown menu will start with Canada. The macros change to the country/region/city of the person watching the page. So if you would add a line like: SweetSaviour - find a friend in {%GEO_COUNTRY%} it will change into SweetSaviour - find a friend in Canada (for you in this example).
Lisa
Hi everybody,

nurijk, thank you for the comments - you are completely right, godfly just needs to remove the "selected="selected"" part from the code for this pupose.

And geo-targeting works exactly the way you described, the same goes for region and city. Please mind that city targeting is not always accurate because of the mechanism the IP-addresses generally get assigned.

Regards,
nurijk
If you only want results for a specific country, say like only results from the UK like for example my uksexcontacts.net. Change the member criteria to the target country. I changed both the "looking-for" and "member criteria" columns. Then you can remove the whole drop down menu with all the countries from your html. Thats what I did with for example http://www.uksexcontacts.net.

You can make a backup before changing it by saving it. Then if something goes wrong you can revert back to a previous version.
godfly
QUOTE(nurijk @ Mar 2 2009, 08:57 AM) *
If you want the default country to be Canada just change the selected="selected" part. Remove this bit from the UK and add it to Canada. Now the dropdown menu will start with Canada. The macros change to the country/region/city of the person watching the page. So if you would add a line like: SweetSaviour - find a friend in {%GEO_COUNTRY%} it will change into SweetSaviour - find a friend in Canada (for you in this example).


Sorry if I'm not being to clear with my question but I am aware that if I move that "selected" to Canada, the pull down will default to Canada but that is not the effect that I am after. I would like the pulldown menu to default to wherever the user browsing the site is located.

Thank you for your tip regarding the use of {%GEO_COUNTRY%}. How can I use that with the country list pull down menu?
Lisa
Dear godfly,

This is how the search works - if you remove the "selected" tag completely from the search, it will default to the country that the user if from determined by the IP address - you don't need to use the macro for this.

Regards,
godfly
Thanks. I modified the code (see below) but it still defaults to United Kingdom. I'll give it a couple hours. Thx!

<select name="seekingCountryId" id="seekingCountryId" class="formSelect" style="width:120px">


<option value="0" >All countries</option>

<option value="203">United Kingdom</option>

<option value="13" >Australia</option>

<option value="14" >Austria</option>
Lisa
Dear godfly,

If you scroll down you will see that there is one more United Kingdom in the list - that one should have been de-selected as well.

I have deselected it in your admin, and now it defaults to all countries. I will find out how to default to your country by IP address now and will let you know.

Regards,
godfly
Thank you Lisa.

I'm really starting to doubt my grasp of the English language now but what I'm trying to say is I don't want the Country list to default to anything but the country of the user browsing the site.

Like if you go to www.sweetsavior.com, you would see United Kingdom right away instead of selecting "United Kingdom" for your country. And since I am in Toronto, I would like to see Canada right away on the drop down list. And if another user is browsing from Istanbul, he would see Turkey on the list automatically. so on...

I'm sorry if I was a little vague before but I hope this clear things up.
Lisa
Yes, I understood that and that is why it had to wait till morning to know exactly what to do to achieve this.

Now - the answer:

To do it the way you describe so the search country defaults to the visitor country by IP address you need to use not Daniel's code but the Quick Search Macro - {%quickSearchBlock%}

I have put it on your site already.

Hope this helps!
headcoat
Can I expand on this with my query, I am running a county dating site (thats county not country). Is it possible to just show people from that county, at least to start with, maybe with an option to expand the search.

Thanks
Patsy (4601)
Hey godfly I am in Toronto too...small world. Best of luck with your business, WDP is the best

I would get a good design going with your sweetsavior.com as soon as possible and start attracting people to it.

Cheers

QUOTE(godfly @ Mar 2 2009, 10:27 PM) *
Thank you Lisa.

I'm really starting to doubt my grasp of the English language now but what I'm trying to say is I don't want the Country list to default to anything but the country of the user browsing the site.

Like if you go to www.sweetsavior.com, you would see United Kingdom right away instead of selecting "United Kingdom" for your country. And since I am in Toronto, I would like to see Canada right away on the drop down list. And if another user is browsing from Istanbul, he would see Turkey on the list automatically. so on...

I'm sorry if I was a little vague before but I hope this clear things up.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.