GA4 tracks that the value of purchase revenue is less than the event value - google-analytics-4

GA4 tracks that the value of the purchase revenue is less than the event value
Some orders tracked on GA4 have a purchase revenue value less than the event value
I re-ordered these faulty orders the other day and it didn't go wrong
I can't find the reason
enter image description here

Related

Is there a better way to design an E-commerce products database when the products can have multiple price lines?

I'm trying to develop a new products database for a client and I am having a hard time finding a solution to handle the many different prices a product can have.
Variables that can affect the price of a product:
region (where the customer lives).
customer type (whether they're a new customer or a registered customer).
order type (whether you want to purchase the item once or subscribe monthly).
store type (there were many store types, but now they're transitioning to one, but I don't know if they will add more in the future again so I want this to be flexible
Product Table
id
product_name
sku
description
1
Vanilla Protein Powder
1111
This is a description...
Attributes Table
id
associate_type
region
store
currency_code
order_type
1
2
1
11
usd
1
2
2
1
11
usd
2
Product Attributes Table
id
price
product_id
attribute_id
1
49.95
1
1
2
29.95
1
2
I was initially thinking this would be a good route to go, but the issue that arises is on the product page I want to display the price of the product if you want to purchase it once and the price if you wanted to subscribe. The same issue would happen if I also wanted to show a list of product cards on a product category page displaying both prices.
The issue I run into
When I write a query to get the correct products with the correct price lines, I would filter all the products by the variables mentioned above, but I will always want the subscription price and the one-time price, so in the query, I would have to include WHERE order_type = 1 AND order_type = 2 but doing this would return duplicate records of the product/ products because of the different prices for a one-time purchase and a subscription purchase.
Is there a better way to set up the tables I have so that the query would not return duplicate records of the product/ products? Or is there a way to write the query to handle this for me? Or do I even need to switch up my database design altogether?

Need to show Largest Purchase and the date and Last purchase/date and it is not correct

I am only working with two tables.
One is a list of IDs (Accounts that i need to find the information on)
I am looking up those ids in another table (purchases)
The purchase table has a list of every purchase the amount and the date of the purchase.
I need to know the most recent purchase and the date of that purchase and the largest purchase and the date of that largest purchase and the sum of all purchases..
All where the purchase amount is greater than zero. I manage to get this far. But when I try to add anything else the info is wrong.
the FORSPRING table all will have records (most likely multiple) in the purchases tables
`SELECT FORSPRING.ACCOUNTID,MAX(p.purchase_date__c) "LAST PURCHASE DATE"
FROM FORSPRING
LEFT JOIN PURCHASES__c P
WHERE p.amount__c>0
ON FORSPRING.ACCOUNTID=G.ACCOUNT__C
GROUP BY FORSPRING.ACCOUNTID
ORDER BY "LAST PURCHASE DATE";`
I think you are looking for a subquery instead.
SELECT FORSPRING.ACCOUNTID, (SELECT MAX(purchase_date__c) FROM PURCHASES__c WHERE o.amount__c>0 AND FORSPRING.ACCOUNTID=G.ACCOUNT__C GROUP BY ACCOUNT__C) "LAST PURCHASE DATE" FROM FORSPRING GROUP BY FORSPRING.ACCOUNTID ORDER BY "LAST PURCHASE DATE";

Huawei IAP - Currency conversion is not correct

In Huawei HMS services, i have integrated IAP kit in my application. IAP currency configured as INR, however for the region Cambodia (KH)-the converted currency value with respect to the pack is incorrect.
In my AppGallery console, product management page, the conversion is 11.99 for KHR-Cambodian currency. But the settlement the conversion is different.
Please can somebody check and let me know how to set conversion correct.
Select a country or region and its currency to be displayed by default, set Default price (tax included), and select a sorting rule. Then, select the countries and regions for which you want to convert prices based on exchange rates and click Convert prices to calculate their local prices.
For details , please refer to: https://developer.huawei.com/consumer/en/doc/distribution/app/agc-help-create-product-0000001099854866
Please Note:
After you click Convert prices, local prices for the selected countries and regions are calculated based on exchange rates and conversion rules.
You can also manually change a product price for a specified country or region on the list as required.
If a message displays, indicating that no exchange rate is found when you convert the price for a country or region, you need to manually enter the product price.
Huawei will update the exchange rates every day but will not update the product prices you have saved. You need to manually update the prices as required.
Click this link https://developer.huawei.com/consumer/en/doc/start/merchant-service-0000001053025967#section154132916309 to view tax rates of different countries and regions.

Tableau: Getting Aggregate Count Based on Boolean Attributes

I am really new in Tableau and I would be needing help in some calculation.
My simplified data consists of three columns:
customer no, transaction date, lost_flag
here lost_flag is a boolean which marks as true if a customer made a transaction in the last 365 days.
(max([transaction date)< dateadd('year',-1,max([Report Date])))
I need to find the:
1. number of customers that are lost
2. number of customers that are not lost
3. attrition rate
For number one, I initially did
countd(if ([Lost_flag]) then [Customer No] else "" END)
But obviously it did not work.
Note: Customer_No is not unique here since this is a transactional sales data source
Thanks in advance.
First you need to make sure that your lost flag is being calculated at the customer level rather than the transaction level. In order to do this use the following formula, note that it is similar to yours however I have made it be fixed at customer id and also replaced report date with todays date:
Lost Flag = { FIXED [Customer ID]: (max([Transacton Date])<dateadd('year',-1,max(TODAY())))}
This will add a TRUE or FALSE flag against every transaction for a customer.It is important that this is fixed at the customer id level rather than the transaction otherwise all old transactions for a customer will be flagged as lost even if they have a recent transaction.
So in order to see how many customers are lost do the following:
1) drag lost_flag onto the rows shelf
2) drag customer id onto the text mark and then right click- measure - count distinct.

Paypal IPN using PHP to get customized Quantity and Amount

I have downloaded the sample paypal IPN script using php and customised with the email for the buyout option and it has also some hidden paramaters such as amount, quantity,return_url, notify_url like this. My main idea is to do the buyout option for the product purchase in my website.The current calculation for the product purchase is as follows:
Item Price:$20
Quantity :10
Total amount $200
I need the calculation to some different way as our site have some static set of quantities and prices, so our point of calculation is as follows:
Item Price:$20
Quantity :10
Total amount:$20
So, the total amount needs to be the same for the given number of quantities.The IPN configuration doesn't allow me to change the quantity field by this way, please suggest some ideas to overcome this issue.
The item price is price per item, the quantity is of course multiplied by the item price. Your second example should have $2 as the --Item-- price. If you want to sell "10 items for $20", I think you will need to make a new item for that combo and just but the actual quantity in a custom field.
If you want to use the same item and paypal's quantity field, I think you need to look into calculating a discount and making that part of the parameters (discount_amount_cart or discount_amount_X for item X I think).