Question

After changing our app to use the new Event Timezone migration, I can no longer display the events address. I used to pass in the venue object with the street, city, state, zip, and country.. then I would also place that information directly in the event object (because the venue never worked even though the api said it was there).

From the graph api documentation for "creating an event from a page" it seems they have done away with venues (and directly entering address information), and now only has location and location_id. I need to be able to manually enter the address information and have it display on the event as I have no guarantee there is an existing facebook location for our clients venues. Is this still possible?

var eventData = {
                name: "<%= Me.EventName %>",
                page_id: "<%= Me.CurrentAcct.FacebookPageID %>",
                description: "<%= Me.EventDescription.Trim() %>",
                start_time: starttime,
                location: "<%= abc.Web.Script.Serialization.JavaScriptString.QuoteString(Me.Venue.Title) %>",
                street: "<%= abc.Web.Script.Serialization.JavaScriptString.QuoteString((Me.Venue.Address1.Trim() + " " + Me.Venue.Address2.Trim()).Trim()) %>",
                city: "<%= abc.Web.Script.Serialization.JavaScriptString.QuoteString(Me.Venue.City) %>",
                state: "<%= Me.Venue.State %>",
                zip: "<%= Me.Venue.Zip %>",
                country: "<%= Me.Venue.TwoLetterISORegionName %>",
                privacy: "<%= Me.Privacy %>",
                ticket_uri: "<%= PublicPageHelpers.BuyTicketsURL(CurrentAcct.Key, objEvent.ID, String.Empty, LinkTypes.Absolute) %>"
           }
Was it helpful?

Solution

So after days wasted trying to figure out how to display the location as a string on the event page this is what I learned. Do not pass in the street, city, state, zip, country into the event object OR the venue object. If you do, facebook will try to use their own Venue location and draw it on a map which results in the City ONLY being displayed if the location does not exist. Also facebook will not display the location string you passed in, but only the map. So as long as you provide the location field without passing the address in somewhere else you can display it as a string on the event page.

var eventData = {
                name: "<%= Me.EventName %>",
                page_id: "<%= Me.CurrentAcct.FacebookPageID %>",
                description: "<%= Me.EventDescription.Trim() %>",
                start_time: starttime,
                location: "<%= abc.Web.Script.Serialization.JavaScriptString.QuoteString(Me.Venue.Title) +"\r\n"+ abc.Web.Script.Serialization.JavaScriptString.QuoteString((Me.Venue.Address1.Trim() +" "+ Me.Venue.Address2.Trim()).Trim()) +"\r\n"+ abc.Web.Script.Serialization.JavaScriptString.QuoteString(Me.Venue.City) +", "+ Me.Venue.State +" "+ Me.Venue.Zip %>",
                privacy: "<%= Me.Privacy %>",
                ticket_uri: "<%= PublicPageHelpers.BuyTicketsURL() %>"
           }

OTHER TIPS

[…] and now only has location and location_id. I need to be able to manually enter the address information and have it display on the event as I have no guarantee there is an existing facebook location for our clients venues. Is this still possible?

Yes – using the first of the fields you mentioned, location.

Its type is just string, and you can pass anything in there that you like. (Althoug I don’t know what character limit is applied, but I think for a “normal” address it should be enough.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top