how to choose Optimized CPM - facebook-ads-api

I am using the ads api of facebook and I want to set the optimization & pricing to Optimized CPM and then select Use Default Bids.
I need:
bid_type=ABSOLUTE_OCPM
but what is the value that I have to set in the bid info?
I want Facebook to decide the bid info.
this is the document of Optimized CMP:
https://developers.facebook.com/docs/reference/ads-api/optimizedcpm/
Any help appreciated!

You have to set a value in bid_info as the API does not allocate one automatically.
The value you set should be the value the advertiser considers each to be worth. In the following example, the advertiser values actions to be worth 500 cents in local currency:
"bid_info={'CLICKS':0,'REACH':0,'SOCIAL':0,'ACTIONS':500}"

Related

Avoid Braintree recurring-billing for a single subscription

I need to let users choose to block a monthly recurring-bill.
Default subscription options are:
never_expires: true,
number_of_billing_cycles: nil
Is
never_expires: false,
number_of_billing_cycles: 0
the proper update to a subscription to accomplish that? Is 0 allowed as value for number of billing cycles? I want to update the subscription for a single user so that is not paying on the following month
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
You should be able to accomplish your goal through creating a discount. You'll need to create a discount associated with a plan via the Control Panel. However, via the API you'll be able to add a discount to the subscription. Specifically, you should create a discount on the subscription that equals the amount of the subscription in order to bypass a month.
Braintree doesn't really do this (at least, that I can tell...)
The way I would approach a 'free month' sort of thing is to simply do a refund for that month https://developers.braintreepayments.com/guides/recurring-billing/manage/php#refunding-a-subscription

design of car booking application using elasticsearch

I need some help in designing car booking application.
There is a document with information about car (title, model, brand, info, etc.)
Problems I'm stuck with are:
How to store available booking days? (I suppose I could use nested
free date range objects in array)
How to store price per day (it's possible to have individual price
per day)?
Booking days and prices could change often. So the third question is: "how to update them cleverly (partially), so I shouldn't read the document, and then store it". I'm looking at script solution using
update api (http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html), but it looks ugly. Maybe there are other approaches?
Thanks,
Alex
with the introduction of the range datatypes, there is no need to use a real nested object, if you meant that.
That might also help you with storing the prices, but that could just be any object I suppose (it depends if you want to search for that as well).
Update API was made for exactly that use-case, that you do not need to get the whole document, so that shounds like a plan.

Globally set Qty Uses Decimals magento

Is there a way to globally set the "QtyUsesDecimals" option in magento? My
I'm setting up a Magento site for a client who sells Fabric and other related materials. There is a minimum of .5 yards for any one Fabric product, After that, it can go to any amount, but the minimum is .5. Currently I'm able to type in .25, .125, etc. and add those to the shopping cart.
I only want this to apply to the Fabric products (there are around 2000 different fabric products) but not to the other types she sells on her site, like Rulers, needles, buttons, etc... I don't want people to be able to purchase .5 buttons.
Thanks
I was wondering the same thing, and I just googled this for you and in exactly 5 seconds.. I got the answer (and comprehended it too, mind you):
https://magento.stackexchange.com/questions/6193/magento-product-quantity-uses-decimals
And to apply this to just fabrics.. it should be something like this:
UPDATE `cataloginventory_stock_item`
SET `is_qty_decimal` = 1
WHERE `product_id` IN (
-- INSERT SUBQUERY HERE THAT GETS ALL PRODUCT ID's UNDER THE 'FABRIC' CATEGORY --
-- IT WOULD START WITH 'SELECT `product_id` FROM ..' you do the rest I believe in you --
);
For new/incoming products.. No, there isn't a global config that controls this, and no you can't set it in Default Configuration as it is already a global attribute. Unless, you are willing to invest some time into making an Observer module that sets that attribute for all new products that are created -and- saved (successfully).
There is a database query to solve this issue if the not fabrics products are just a few, or none.
This solution is not update safe and shouldn't be used unless you really understand what you're doing.
ALTER TABLE `cataloginventory_stock_item`
CHANGE COLUMN `is_qty_decimal` `is_qty_decimal` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '1' COMMENT 'Is Qty Decimal';
This will change just the default value of this column from DEFAULT '0' to DEFAULT '1'. In Magento 1.7.0.2 the other column fields are untouched, so you can check the query to see if your database version corresponds. Then you should check and rerun this query on each database update.
After executing this query you should modify the value back to '0' to the non fabrics products: you can do all at once via query (check Seth Jeremi Malaki's answer) or through the Admin interface (product->stock) one by one (the secure way).
Otherwise, if the fabric products are a lot less (or none), just keep the database at its state and modify only the fabrics via the admin interface.

Sitecore Analytics report anonymous users vs members

I'm trying to set up a report in Sitecore Analytics that will report on the number of visitors split by members/non-members. I've looked in the Visitor and Visits tables but as far as I can see there's nothing that tells me if it was an anonymous user or not. Do I need to set up visitor profile to be able to get what I want, or is there a simpler way?
DMS has a field for this, Visitors.ExternalUser, but you need to write code to populate it. Include this code in your Login handler:
if (Tracker.IsActive)
{
Tracker.Visitor.ExternalUser = Sitecore.Context.User.DisplayName.ToLower();
}
You can then compare the number of visitors with this field populated to the total number of visitors.

Are shopify apps limited to touch only products and post-sale?

I've read through all the API documentation and looked at the shopify app PixelPrinter on github and I'm not seeing anywhere in the doc's where I can have a customer add a custom dollar amount on checkout to go to a specific cause.
Is it possible to add a drop down field to the cart/checkout screen via my app (or instruct them how to add this) and have that selected value end up in the order? Maybe i'm thinking about this all wrong?
If you want to collect money using Shopify, you need to sell Products. A product can have variants and each one has a dollar amount. You cannot sell any product for a random amount of money. You could create a product called Donation, and assign some values to it, allowing a customer to select from some amount of money available as a variant, which you then assign to their favorite cause.

Resources