Hi Anash,

With languages, I have a list of predefined criteria ids; also with
locations, I have the criteria ids for each of the cities in the US.
However, I don't know how to predefine the criteria id for a
proximity. What can I do with the issue?

(I get the values of a proximity from database server and then add the
proximity targets to CampaignCriterionService:


                    List<Proximity>() proximityList = new
List<Proximity>();

                    while (reader.Read())
                    {
                        Proximity newTarget = new Proximity();
                        decimal lat = 0;
                        decimal lon = 0;
                        int radii = 0;

                        try
                        {
                            GeoPoint geoPoint = new GeoPoint();
                            lat = decimal.Parse(reader["Lattitude"] !=
null ? reader["Lattitude"].ToString() : "");
                            lon = decimal.Parse(reader["Longitude"] !=
null ? reader["Longitude"].ToString() : "");
                            lat = Math.Round(lat * 1000000);
                            lon = Math.Round(lon * 1000000);
                            decimal distanceinKM =
decimal.Parse(reader["Radius"] != null ? reader["Radius"].ToString() :
"") * decimal.Parse("1.6");
                            string sRadii = distanceinKM.ToString();
                            if (sRadii.IndexOf(".") > -1) radii =
Int32.Parse(sRadii.Substring(0, sRadii.IndexOf(".")));
                            else radii = Int32.Parse(sRadii);
                            if ((lat != 0) && (lon != 0) && (radii >
0))
                            {
                                geoPoint.latitudeInMicroDegrees =
Int32.Parse(lat.ToString());
                                geoPoint.longitudeInMicroDegrees =
Int32.Parse(lon.ToString());
                                newTarget.geoPoint = geoPoint;
                                newTarget.radiusDistanceUnits =
ProximityDistanceUnits.KILOMETERS;
                                newTarget.radiusInUnits = radii;

                           ....
                 } //end while

)



On Jan 9, 2:19 am, "Anash P. Oommen" <[email protected]>
wrote:
> Hi Minh Le,
>
> The new IDs should have predefined criteria ids. E.g. Language cirteria ids
> are athttp://code.google.com/apis/adwords/docs/appendix/languagecodes.html.
> Also, I'd probably add the new target ids to a Dictionary, and add one FOR
> loop to see which of the new targets are common in the existing list and
> new list. Dictionary lookup is cheaper than a nested for loop.
>
> Cheers,
> Anash P. Oommen,
> AdWords API Advisor.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to