Ad Group October 2nd 2013 changes: bid_info is returning still numeric indexes instead of strings - facebook

we have enabled the October 2nd 2013 breaking changes for our application yesterday, the change to the application settings is already confirmed. If I submit bid_info in the new format (with strings instead of numeric indexes) it works:
"bid_info": {
"CLICKS": 75
}
When I try to read the ad group with a request to its url later, I get a bid_info and a max_bid setting in parallel (I expected that max_bid will be removed in October 2nd-mode), but the bid_info contains the numeric index and not the expected CLICKS-string:
(...)
"adgroup_status": 3,
"bid_type": 1,
"max_bid": 75,
"bid_info": {
"1": 75
},
"ad_status": 3,
"locations": [
3
],
(...)
Any suggestions for that? Is this bug or by design? Or did something went wrong with the activation of the October 2nd changes for our application?
Bye
Tobias

Same for me but without activating october 2nd breaking changes...
It's quite strange to have number as name field and it is not allowed in languages like in c#.
It should be this kind of info:
A dictionary of values that you place on your bid
CPM={'REACH':cent_value}
CPC={'CLICKS':cent_value}
oCPM or CPA={'ACTIONS':cent_value}
I've 1, 38, 44, 55 in place of this.
Update, it's actually this:
Actions: 55
Reach: 44
Clicks: 1
Social Impressions: 38
More info: https://developers.facebook.com/docs/reference/ads-api/optimizedcpm/

https://developers.facebook.com/bugs/539767489417940?browse=external_tasks_search_results_5203fffd63da04c48847913
I actually filed a ticket against this. The Facebook bug response said it would be fixed on July 17th, however a contact at Facebook elevated this ticket after it was not fixed on July 17th, and it is now being currently worked on.
We were told it should be functional by the end of August.

Related

Can not use expression language functions from Events Trigger body

I am using events trigger in ADF v2. My trigger parameter values look like this:-
"parameters": {
"FolderPath": "#triggerBody().folderPath",
"FileName": "#triggerBody().fileName",
"Year": "#{split(#triggerBody().folderPath,'/')[2]}",
"Month": "#{split(#triggerBody().folderPath,'/')[3]}",
"Day": "#{split(#triggerBody().folderPath,'/')[4]}",
}
I initially ran it with just 2 initial parameters and the sample values for FolderPath look like this as seen from ADF monitor after a run is succeeded:-
test/poc/2019/09/20/00
But when I add other parameters to it, like Year, Month, Day as shown here, while publishing the changes, I get an error 'Trigger activation failed':-
When I hard coded Year, Month, Day in the trigger, it again started working. I am guessing some issues in calling expression language functions from event based trigger. I am basically trying to dynamically calculate individual elements from FolderPath such as 2019 as Year, 09 as Month and so on. How to achieve this?
Pasting DraganB's comment as an answer here:-
Try
"Year": "#{split(triggerBody().folderPath,'/')[2]}", "Month": "#{split(triggerBody().folderPath,'/')[3]}", "Day": "#{split(triggerBody().folderPath,'/')[4]}"
Basically delete # before triggerBody

RRULE for first Advent

I am currently trying to setup my own holiday iCalendar to which I can subscribe on, since I don't want to depend on 3rd party services.
I am currently trying to make the the VEVENTs for Christmas. The 2nd, 3rd and 4th advent, as well as the Christmas holidays are straight forward, however I have big issues to model the 1st advent.
Specifically, the problem is that the first advent can be in November and December (27th November to 3rd Devember)
How can I make a recurring event (or, more specifically, the RRULE) to cover all cases for the 1st advent?
What I've tried
My first idea was this:
FREQ=YEARLY;INTERVAL=1;BYMONTH=11,12;BYMONTHDAY=27,28,29,30,1,2,3;BYDAY=SU
The idea was to just pick the one Sunday in between 27th November and 3rd December. This does of course not work because BYMONTH expands the search to all days in November and December, and BYMONTHDAY limits the search to those days in both months. I.e. November 1st, November 2nd, ... December 27th, December 28th, ..., which is of course not what I want.
Next, I tried to use BYYEARDAY=331,332,333,334,335,336,337 instead of BYMONTHDAY and BYMONTH, but unfortunately my webdav server (Nextcloud, which uses Sabre as far as I know. I got an error message "Invalid BYYEARDAY rule") does not support this.
My next idea was to use multiple RRULEs -- at least I did not see any passage in the RFC stating that only one RRULE is allowed at most. So I ended up with:
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=SU;BYMONTHDAY=27,28,29,30;BYMONTH=11
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=SU;BYMONTHDAY=1,2,3;BYMONTH=12
Didn't work as well. My last resort was to create two separate VEVENTs, one with the first RRULE above and one with the second RRULE above, but otherwise identical. This worked, but it left me confused.
Is there no better solution? How would you do it?
unfortunately my webdav server (Nextcloud, which uses Sabre as far as I know. I got an error message "Invalid BYYEARDAY rule") does not support this.
Well I think you should raise a bug report, because as far I can tell your solutions are correct and RFC-compliant.
I tried your solutions 2 and 3 with different libs (my own lib php-rrule, and rrule.js) and both options seems to work just fine.
FREQ=YEARLY;BYDAY=SU;BYYEARDAY=331,332,333,334,335,336,337
or combining 2
FREQ=YEARLY;INTERVAL=1;BYDAY=SU;BYMONTHDAY=27,28,29,30;BYMONTH=11
FREQ=YEARLY;INTERVAL=1;BYDAY=SU;BYMONTHDAY=1,2,3;BYMONTH=12
will both produce:
2018-12-02
2019-12-01
2020-11-29
2021-11-28
2022-11-27
2023-12-03
2024-12-01
2025-11-30
2026-11-29
2027-11-28
which according to Google and Wikipedia are the correct dates for the 1st Advent Sunday in the next 10 years.
Side note
at least I did not see any passage in the RFC stating that only one RRULE is allowed at most.
While not strictly forbidden, in RFC 5545 it's literally written everytime RRULE is mentioned:
;
; The following is OPTIONAL,
; but SHOULD NOT occur more than once.
;
rrule
Appendix A even states in the "New restrictions":
2. The "RRULE" property SHOULD NOT occur more than once in a
component.
That being said, multiple RRULE is a great feature, I don't know why they restricted it.
If I'm not mistaken, the first Advent is always the fifth last Sunday in a year. So the following rule should do the trick:
FREQ=YEARLY;BYDAY=-5SU
See the next 10 results: http://recurrence-expansion-service.appspot.com/reaas?dtstart=20181202&rrule=FREQ%3DYEARLY%3BBYDAY%3D-5SU&max_instances=10
Or to put it another way:
FREQ=YEARLY;BYDAY=SU;BYSETPOS=-5

Drupal - date field language when used for RSS

I have a problem with the following scenario.
I set up a node with a date field with type "Date (ISO format)".
To display that nodes in a RSS feed, i created a view from content and format RSS-feed. In addition i set up a custom date format via "r" (RFC 2822) or (D, d M Y H:i:s O) in Drupal and used it for that field "field_time". That field is used as pubDate.
The date field creates instead of:
Wed, 01 Jul 2015 00:00:00 +0200
the "german" version.
Mi, 01 Jul 2015 00:00:00 +0200
If i do the same with for example the "created" date i get the correct english output.
I have allready tried to set the "field language" of that view to english.
Also i tried to programmatically change the output in the rows tpl (overwhelming my php knowledge).
Its a very similar case like here.
Maybe someone can get me a hint to alter that field, change it in the rows template or something similar.
Thanks in advance!
After some trail and error, i rewrote the output of my field "field_time" via the views templates at field level. I get the raw value from the field, converted it "again" in the RFC 2822 format and it sticks in english.
$rawdate = $row->field_data_field_time_field_time_value;
$unixdate = strtotime($rawdate);
print date('r', $unixdate);
I modified it after that a bit to get other nodes also in the feed which have only e.g. node_created via "rewrite if empty" in the views UI.
if (isset($row->field_data_field_time_field_time_value)) {
$rawdate = $row->field_data_field_time_field_time_value;
$unixdate = strtotime($rawdate);
print date('r', $unixdate);
} else {
print $output;
}
Im not sure, if that is very clean. Suggestions still welcome.

Abstract temporal searches in Elasticsearch

I'm having trouble wrapping my head around the best way to solve this and could use some outside opinions. In my ES data, I have news articles from the past ~100 years. I'm trying to figure out the best way to search for articles by attributes of a date, not a date range. Here are some for-instances:
Get articles "on this day", e.g. April 15, regardless of year.
Search for articles written between specific hours, e.g. 9am-5pm, or days of the week e.g. Saturdays and Sundays.
Search for articles written during June, July, and August (again, regardless of year).
... and so on. The best solution I've come up with is to store these attributes separately in the index, e.g.
{
"publish_date": {
"full": "2014-04-15 12:34:56",
"year": 2014,
"month": 4,
"monthname": "april",
"day": 15,
"dayofweek": "tuesday",
"dayofyear": 105,
"hour": 12,
"minute": 34,
"second": 56,
"week": 16
}
}
I'm not happy with this solution and I want to break up with it.
Any thoughts on what you would do differently, or how you'd solve this problem?
Thanks!
first off, why aren't you happy with it? It's perfectly fine and in-line with the 'denormalization' hat you probably need to start wearing when doing document-modeling in ES (and other denormalized / nosql databases)
Having said that, you don't need to write the different fields in your own indexing-code. Instead you could go for:
using multi-fields, which allows 1 input field to be indexed to multiple ES-fields, each with there own mapping. http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-core-types.html#_multi_fields_3
define such a ES-field for each date-mapping you want to do: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-date-format.html

Unsure what get(Calendar.DAY_OF_WEEK) returns

My problem can be easily created by the scenario below:
//create a gregorian calendar object that set the date and time as 4th June 2012 at 10:30PM
Calendar calendar = new GregorianCalendar(2012, 6, 4, 22, 30);
//when I print out these:
System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
System.out.println(calendar.get(Calendar.MINUTE));
System.out.println(calendar.get(Calendar.HOUR));
System.out.println(calendar.get(Calendar.DATE));
System.out.println(calendar.get(Calendar.MONTH));
System.out.println(calendar.get(Calendar.YEAR));
//output reads as:
4
30
10
4
6
2012
//so does calendar.get(Calendar.DAY_OF_WEEK) == calendar.get(Calendar.DATE) ???
Just so that everyone is clear the 4th of June 2012 is a Monday, so shouldn't calendar.get(Calendar.DAY_OF_WEEK) return 0 as part of the first day of the week?
Thank for your all your help and concerns, please also verify the source that you are referring to.
user1442080
The month in java Calendar classes is 0-based. So June is month number 5.
You actually created an object representing July 4th, which happens to be a Wednesday, which is the fourth day of that week.
One should always look for values returned by Calendar.{field} e.g. like Calendar.SUNDAY, Calendar.MONDAY, Calendar.JANUARY, Calendar.MARCH etc. and so on.
This is because, the values returned by Calendar.{field} depends upon the TimeZone specified while creating Calendar instance.
You can try this by creating two calendar instances with different timezones:
Calendar.getInstance("BST")
and
Calendar.getInstance() // default timezone
and now try getting calendar.get(Calendar.DAY_OF_WEEK) which will return different integer values for these two instances.