Firebase Analytics: view_item's custom parameters are mostly (not set) - firebase-analytics

I have a Flutter app that records view_item events in Firebase Analytics. Here is the code:
FirebaseAnalytics.instance.logViewItem(
items: [
AnalyticsEventItem(
itemId: myItem.id,
itemName: myItem.name,
itemCategory: myItem.category
)
]
);
This event is correctly recorded in Firebase Analytics. However, the parameters (itemId, itemName, itemCategory) are mostly displayed as (not set):
I don't understand why some ITEM CATEGORY and ITEM ID are correctly displayed but most of them are (not set).
FYI, I have registered those parameters in my Custom Definitions:
Does anyone understand what wrong is going here?
Thank you very much in advance

Related

Sequelize select statement for this example with express get method

I have these 2 words:
The words in mysql db
And I have this category:
The category
As we can see in the word-table, the words have also a categoryId attribute.
I've made an junctiontable in case I need it but it's currently empty, it looks like that:
junction table
I want to display a list in my ui that is a admin-panel that would look like this for example:
Words
Category
God
Religion
Ford Mustang
Cars
Every word has exactly one category.
To do that I want to use axios to fetch a get request of my node.js server.
What would look the get method with the corresponding sequelize query to get the data and maybe also the method in the react ui?
I'm trying to figure it out for about two days now and I can't get out of this shithole...
What is the project*:**
Full stack web app that simulates the game "wheel of fortune". Contains a auth-system where admins can also make CRUD options for words, questions and create categories that belong to a word or question. Classic users can only play the game.
Technologies:
React -> Frontend
Node.js Backend -> Express.js and Sequelize
Database: MySQL with mysql workbench
Assuming model name for Words table is Word and Category for category table the code to query all the data would be such:
const words = await Word.findAll({
where: {
// here you can do filtering if needed
},
include: [
{
model: Category,
attributes: [
'category',
],
as: 'categories',
},
],
});
This will return list of words and associated categories. Then you would just create api endpoint and return queried data and display on frontend.

What is the "arg" field value that is sent on woocommerce_add_to_cart webhook?

I would like to know whether an addition of a product to a cart occurred on woocommerce. On the documentation it says that an application should consume a webhook that notifies about a woocommerce_add_to_cart action.
So I implemented it and gladly got a message saying it happened a short while after such an event occurred.
Here's an example JSON I got from woocommerce:
{"action":"woocommerce_add_to_cart","arg":"fe9fc289c3ff0af142b6d3bead98a923"}
However since many visitors of a woocommerce website may have their own cart, and many products, I would like to know if there's a way to decode the arg field so that it will provide a unique product that was added to a specific cart.
In case I am using the wrong method in order to learn about an addition to a cart, I would be happy to learn which one may be better for me.
The 'arg' value is the cart item key that is passed through woocommerce_add_to_cart action hook as an argument, and that is returned on WC_Cart add_to_cart() method on line 1120:
do_action( 'woocommerce_add_to_cart', $cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data );
return $cart_item_key; // <========= HERE
That cart item key allows you for example to get the cart item using WC_Cart get_cart_item() method and retrieve the cart item data:
$cart_item = WC()->cart->get_cart_item( $cart_item_key );

How to filter data using angular 4 route params

Can anybody please explain how I can use Angular (4) route params to filter a JSON object to only return 1 record (so I only want to show more specific details, bit like an admin panel). All the examples I've seen just seem to show you how to console.log the param id from the url and don't really go much further (or if they do it isn't explained as clearly as I would like).
What I want to do is I have a JSON object say
{id: 1, name:"Dave"}, {id:2, name: "Steve"}
How can I use the route param in a service to show only the name based upon the id I pass in the url?
name/1
So this example would give me access to the first set of records.
Thanks

Marketo API Custom Data

I am using the Marketo API V1 to get lead data from a customers Marketo account. I have successfully connected to the API (by going through their documentation).
I can get data for a single lead however it only displays the default data (id, firstName, lastName, email) and I know there are a lot of custom data fields (company, salutation, jobTitle etc.) but this does not show from the API - do you know how I can access this custom data?
Below is the API URL I am using which works fine just not showing all the data I require:
https://<<url>>/rest/v1/leads.json?access_token=<<token>>&filterType=email&filterValues=oliver#test.com
This returns:
{"requestId":"1261b#14f40fc3156","result":[{"id":2755951,"updatedAt":"2015-08-18T10:58:42Z","lastName":"wells","email":"oliver#test.com","createdAt":"2015-06-02T09:36:48Z","firstName":"oliver"}],"success":true}
Thank you very much!
You need to include a parameter, 'fields', which has a comma-separated list of field names to retrieve a given set of fields: http://developers.marketo.com/documentation/rest/get-multiple-leads-by-filter-type/ See example 2, there.

Couchbase compound keys in views with the C SDK

I'm trying to implement a very basic C application that queries a Couchbase view using the C SDK. I got the SDK as such working since I can retrieve data from the DB server and even query views with a range query (startkey and endkey). However, if I create a view with a compound key, i.e. an index with two values, then I get nothing back. If I implement the same view in PHP or Node I get the correct data back. My understanding of the C SDK is that it uses the REST API of Couchbase, so the options string (optstr) is essentially the same as if I would use the Couchbase in-built web management console. Using single numeric start and end keys I get it all to work, but as soon as I start using compound keys like
startkey=["test",2]&endkey=["test",4]
I get no results back. The query string that does return data looks like
startkey=2&endkey=4
The bucket has only 5 documents of the following structure:
{number: 1, name: "test"}
with the number simply being between 1 and 5.
the view for the compound key looks like:
function (doc, meta) {
emit([doc.name, doc.number], doc);
}
and the one for the single key simply has the doc.number as the first value in the emit without being an array.
The code that I'm using for the compound key in C looks like:
lcb_CMDVIEWQUERY vq = {0};
vq.optstr = "startkey=[\"test\",2]&endkey=[\"test\",4]";
vq.noptstr = strlen(vq.optstr);
lcb_view_query_initcmd(&vq, "ddoc", "myView", NULL, viewCallback);
lcb_error_t rc = lcb_view_query(instance, NULL, &vq);
What am I missing for the compound views? The examples on the Couchbase website don't cover views using any keys and the examples in their Git repository don't have any examples either. The Couchbase C SDK seems to be a but light on documentation, even the API documentation doesn't seem to be very detailed.
Any help is appreciated.
It would help if the view with the compound key would actually being published! The code actually does work as intended. However, it would be interesting to get peoples views on the formatting of the query/option string and if it should be URL encoded or not when created.
Update:
After setting up a new Couchbase server and populating it with the same data set and rebuilding the view it actually does work. So I have no idea why it didn't work against the original server. I have gone through the map function with a fine toothed comb and checked the correct spelling (uppercase/lowercase) of all variables and parameters. At least it does work. :)