FB Ads API status , effective_status and the ads actual status - facebook-ads-api

From the ads api doc it says
effective_status enum {ACTIVE, PAUSED, DELETED, PENDING_REVIEW,
DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO, CAMPAIGN_PAUSED,
ARCHIVED, ADSET_PAUSED} The effective status of the ad. The status
could be effective either because of its own status, or the status of
its parent units.
status enum {ACTIVE, PAUSED, DELETED, ARCHIVED} The configured status
of the ad. The field returns the same value as 'configured_status',
and is the suggested one to use.
BUT, the problem is unless the advertiser actively stops or pauses or deletes an advert or campaign the ad's status is always (as far as I can see in the aforementioned cases) ACTIVE. Am I wrong?
Secondly, does anyone know what the column on the Ads manager interface called "Delivery" is? It has values like "Completed" , "Not Delivering" etc.
Is there any way I can get this information from the API?

The field called 'delivery' in Facebook's UI is not a single field returned by the UI, but is based on examining the status, start/end dates, etc of the ads–you could replicate this yourself by examining the ads and their parent objects.
I'm not sure I understand what you're saying about "configured and effective status": if an ad was paused, both its effective and configured status should be PAUSED. If, for example, an ad's Ad Set was set to paused, the ad's configured status would remain ACTIVE but its effective status would be ADSET_PAUSED.

How is the status computed?
When you give an Ad a status via the API you are setting its configured_status. This will update to whatever status you give it ACTIVE, PAUSED, etc.. And this value should reflect immediately in the configured_status parameter via a GET request to the object. The configured_status parameter will show whatever value you last set it too regardless of the parent status.
With that being said, if you have an ACTIVE ad that is nested under a PAUSED adset it will inherit the PAUSED status and that will reflect via the effective_status parameter. You can update the status of an Ad regardless of the status of the adset. It will only inherit the status if the parent is PAUSED to prevent spending.
As status will inherit from the parent object, it is most likely disabled. The effective_status reflects the current status of the object which may be overridden by its parent. More info can be found here
NOTE: I just posted the documentation for the Ad object but this applies to Adset objects as well
The configured_status is synonymous to the status parameter and is what you should set when updating the Ad.
About what the column on the Ads manager interface called "Delivery" is?
According to Facebook, the new feature identifies under-delivering ad sets and explains why the under-delivery is happening and highlights suggestions for specific actions an advertiser can take to make their ad more competitive at auction – in-turn helping them to increase the performance of their advert.
Advertisers can find feedback relating to their ads in the “Delivery” column at the campaign and ad set level, and also under the “Tools” standalone tab in Facebook Ads Manager.
Check these article this might help you to give insights into "Delivery":
In Facebook Power editor
In Facebook Ads Manager
P.S Some things you only learn by practicing and trying during development process you cannot always depend on Documentation.
Hope this helps!!!!

Related

Salesforce Commerce Cloud Shop API Order status update fails

I have a question about the update of the status of an order.
I create the basket using OCAPI and then I can successfully create an order with
https://mydomain/dw/shop/v21_10/orders (POST)
Order is fine. All data are there.
Now the order has status CREATED and I want to change it to OPEN using the Shop API again.
https://mydomain/dw/shop/v21_10/orders/MyOrderNumber (PATCH)
This is the message I receive
{"_v":"21.10","fault":{"arguments":{"statusFrom":"CREATED","statusTo":"OPEN"},"type":"StatusTransitionNotPossibleException","message":"The status transition from 'CREATED' to 'OPEN' isn't possible."}}
While if I try to make the same transition in Business Manager it works perfectly.
Anyone knows why?
The reason you can't transition the order from CREATED to OPEN is because there is a step in between.
Unfortunately, this is poorly documented in OCAPI docs, but we can see a clearer picture if we look at the DW API docs which explain in more detail.
A bit of background
First, notice the description of the PATCH /orders/{order_no} endpoint:
same status transitions are possible as for dw.order.Order.setStatus(int status) plus CREATED to FAILED)
Okay, so it follows the DW API rules. Let's take a look at the Order.setStatus() method (emphasis mine):
This method does not support order statuses ORDER_STATUS_CREATED or ORDER_STATUS_FAILED. Please use OrderMgr.placeOrder(Order) or OrderMgr.failOrder(Order).
So this is telling us that we can't move an order out of CREATED status except by either placing it or failing it. If we take a look at the documentation for OrderMgr.placeOrder(order), it corroborates this:
This method places an order and is usually called after payment has been authorized. The specified order must be in status CREATED, and will be set to status NEW.
Now back to OCAPI
Now we know that OCAPI generally follows the same rules as the DW API when it comes to transitioning order statuses. (with the exception of CREATED -> FAILED)
So how do we go about placing an order with OCAPI?
With OCAPI, you can place an order by calling POST orders/{order_no}/payment_instruments which will trigger the following hooks:
Authorize the payment with either dw.order.hooks.PaymentHooks.authorizeCreditCard or dw.order.hooks.PaymentHooks.authorize, depending on the payment type
Place the order with dw.ocapi.shop.order.afterPostPaymentInstrument
On success of both those hooks, your order will now be in NEW status, and ready to be transitioned into OPEN.
This discussion is on the same topic, although talking about the controller context, not OCAPI.
So, even though business manager lets you get away with stuff (I assume so that admins can override things where necessary), in the context of OCAPI or a controller, the order has to follow the regular placement steps.

Are there any different Twitter pixel events than PageView?

The default Twitter pixel script contains this code
twq('track','PageView');
to trigger a PageView event (conversion).
In the documentation it states:
Choose the type of conversion you’d like to track with this tag. Your Twitter Ads dashboard reports on conversions by conversion type.
Here are the types:
Site visit: User visits your site
Purchase: User completes a purchase of a product or service on your
site
Download: User downloads a file, such as a white paper or software
package, from your site
Sign up: User signs up for your service, newsletter, or email
communication
Custom: This is a catch-all category for a custom action that does not
fall into one of the categories above
Does this mean that I can trigger these conversion types by the twq('track', event) function? If so, what is the syntax?
It appears they've expanded their documentation slightly in this regard, but it's still vague:
A conversion event can be any "Action" that a user completes on your site which you would like to track. It does not have to be a purchase, but can also be a shopping cart update, a newsletter sign up, etc. Choose the type of conversion you’d like to track with this tag. Available tag types are Site Visit, Purchase, Sign Up, Download, or Custom. Choose “Custom” if you’re tracking an action other than the conversion events we’ve predefined.
There is, however, an example of this in the documentation:
Under the question How to setup advanced conversion tracking to monitor campaign ROI? there's this:
You'll notice the Purchase event, above. Unfortunately it doesn't give up the syntax for the two word events like Sign up. Sigh.
There is also this post on their developer forums from an employee (date Jan 2018) indicating they are moving away from the other custom event types:
Due to a roadmap change, we are actively supporting “PageView” and “Purchase” tag types. But this does not mean that you can’t still track sign ups or custom events.
In their documentation there is also this disclaimer:
The purchase tag must executed independently of 'PageView' tag type, otherwise the dynamic values will be overwritten.
This appears to suggest these additional event types must be in replacement of the PageView event, but again it's unclear. If you tell Twitter to create a Purchase conversion event, the snippet it provides still uses PageView. It's very confusing.
Update: From my tests it appears the above code (with Purchase event) fires, and is tracked correctly, by Twitter.

Google Calendar Watch and Events working together

I am creating a Node/Express Webapp that would mirror a user's calendar. It would get a notification for every change in the users calendar, and would update the DB with the latest of that user's calendar.
Lets assume that we want to monitor john.doe#gmail.com. Kindly tell me if this is the best (and only) way to do it:
Set up for Push notification - While doing so, we provide (amongst other fields):
token - A plain-text that would be echoed back. This is where I can put something like 'calOwner=john.doe#gmail.com'
id - A UUID channel id
Upon every change, my webhook will get a push notification that would contain:
token : calOwner=john.doe#gmail.com
id : the channelId - I dont understand if this field alone can be used to trace this notification message back to john.doe#gmail.com
Now that I know john.doe#gmail.com has changed, I would do a list with a synchToken. This will return me the change in john's calendar since last synch
What baffles me here is that the seemingly important fields channelId and resourceId (which appears as x-goog-resource-id in the push notification header) are useless, and the only field that ties the push message to list is an optional plain-text field token .
Kindly tell me if this is the only way to track a user's calendar.
UPDATE
Thanks #KENdi for the answer.
My struggle was with the point that simply looking at a push notification message, there is no way to trace it back to john.doe#gmail.com . I now understand why such is the case, that a push notification does not contain the calendarId, but the resourceId instead (which, in plain terms is the event object). It is so because an event can be associated with multiple calendars, and hence multiple calendarIds. Hence, it is the subscriber's responsibility to maintain association of the channel to the calendarId that he had used to create the channel at the first place.
Yes, you are correct, you need the calendar push notification, to notify you about all the changes happened in the Google Calendar.
The purpose of X-Goog-Resource-ID is an opaque value that identifies the watched resource. And this ID is stable across API versions.
Check this SO question to know more about the purpose of X-Goog-Resource-Id.

Adempiere - How can I create notification due to certain condition through Notice?

I have an Internal Use Inventory Window.
The schema process is that there are 3 people who are in charge of handling Internal Use Inventory.
They are Requester, Andrew and Richard.
When a requester request 5 items via Internal Use Inventory and complete the document,
The document will be delivered to Andrew so that he can approve it.
After document approved by Andrew, it'll be delivered to Richard. As Logistic man he checks whether there's enough stock or not.
Turns out the stock is only 3. So he's not approving the document because the stock is lack.
Thus, the document status become 'Not Approved'.
If the document 'Not Approved', there's a notification to Andrew that the document is not Approved
because the stock available cannot fulfill the stock requested by the User.
How can I make the notification itself ? is it through Notice ?
How can I make the notification through Notice? as I have browse the internet but I still have no idea on how to do it.
Your answer will be much appreciated, Thank you :)
The Notices functionality is intended for System related messaging.
For the process related messages you indicated you would use the Workflow processes and there are some examples in the Garden World demo customer. The Process_Requisition workflow gives you a basic example of something along the lines that you requested.

asp.net mvc 3 - sending an email and getting the return for validation a task (registration, form validation...)

I am having a register form that user fill in, once the form fill in, the registration is postponed till the user recieve an email to check that his email is ok, then when he reply the email, the registration is fully proceed.
I would like also the process to be automatic, without the need for the user to entered any number ect, just the need for him to click on the email to confirm, and automatic on my side too.
I want the process to be available to some others task than the registration process as well if possible.
Do I need to do all way check/123456 with the 123456 generated or is there a better way to do, a component, nuget that can do the job ? you experiences return would be helpful
thanks
You appear to be on the right track.
I do a similar thing quite often. It isn't generic since I do not need it but you can change that quite easily.
Once a user registers I send an activation e-mail that contains a link that when clicked navigates to something such as http://domain/member/activate/id where the id is a GUID. That is all I need. I look up the member id and activate it. Chances of someone guessing a new member's id are rather slim and even if they do it is very far from a train smash.
From what I can tell you need something more generic and a bit more security. You could always create some key (like a new GUID) that you store along with the user and then the activation calls: http://domain/member/activate/id?key={the guid}. You could even encrypt the key. But that is up to you.
For something that can be re-used and is more generic you could create an activation component that contains a list of activation ids. But to then activate a specific type of entity (such as user registration or form validation) you would need to have a way to perform that on the back-end. For example, when you call http://domain/activation/activate/id internally is looks up the id and gets the type. The activation request is, of course, created when, e.g., your user registers. You would probably want to store some expiry/timeout since a user may never activate.
For each type you could have an activation mechanism on the relevant controller: member/activate/key or formvalidation/activate/key. So when you activation controller receives a request to activate it has a list of routes conigured per type and the navigates to the relevant route to perform the 'actual' activation.
Another option is to have an in-process component perform activation e.g.: an IActivator interface implemented by a MemberActivator or FormValdationActivator and then have an IActivatorProvider implementation that gives you the relevant provider based on a type (.NET Type or a string type you provider --- that's up to you).
You could even pass an ActivationRequestCommand along to a service bus endpoint if you are so inclined.
So you have many options. HTH
If you are a developer I suggest you at least try to start with the code... then ask again if you get stuck providing a sample of what you've done.
What you are looking to do is basically use a temporary url that posts to a page to complete the registration...

Resources