Google AdWords conversion value format - google-ads-api

I'm using google tag assistant in my browser, but google tag assistant always shows
Conversion Value should be prefixed with standard currency.
i think the reason is the decimal places value at image tag is not picked up:
<img height="1" width="1" style="border-style:none;" alt="" src=""https://www.googleadservices.com/pagead/conversion/xxx/?label=xxx&value=267500·00&currency_code=IDR&guid=ON&script=0""/>
first i used plain . as decimal places seperator, and then i used · and ¸, but none of this work

Google Tag Manager is a great tool, but I wouldn't take all of its recommendations at face value.
Adwords itself does have a bit of a storied past when it comes to the meaning of conversion values. For a long time, the value of conversion was just a number with no explicit monetary semantic.
As this is not an optimal setup if you are a multinational advertiser that has to deal with problems such as marketing budgets being denominated in local currencies, the option to define a currency for conversions was added.
Note, however, that the conversion value columns in the Adwords interface still show no currency and that the ConversionValue field in the API still has type Double – as opposed to the Cost field, which is of type Money.
Thus, as far as I can tell, the only point where conversion value currencies are important is for situations where a conversion occurs that has a different currency than the billing currency of the Adwords account to which the conversion belongs. In that case, the amount will be converted between the currencies automatically. In all other cases, the conversion value is a number that doesn't care about its currency.
So, to summarize: if you use the same currency for both billing and reporting currencies (and don't use things like MCC-level conversion tracking for accounts with different currencies), you'll be fine.

To fix this warning google_conversion_value on script tag should be change or add.
var google_conversion_value = 'currencyhere' + valuehere;
eg
var google_conversion_value = 'IDR' + 267500.00;
This warning is very misleading as there's a seperate variable that they can use
google_conversion_currency but they require as to append a "currency" prefix on the "value".

Related

Convert text to number in Google Sheets

I'm reading currency values from a website and I'd like to do some calculations with these numbers. They come in this format:
$7,821.24
Here's an example file:
https://docs.google.com/spreadsheets/d/1vHEH_m16KXcDh7hY_BVG9lur1huFjWOnx5bWtgrdGdA/edit?usp=sharing
Now for some reason neither VALUE() and TO_PURE_NUMBER work for me (Can't parse to numberic value, telling me it's a text value).
My guess is that the comma and the $-sign confuse the formula, is there anything I can do to format this correctly? The dollar sign always appears in the values but the comma only appears separating thousands of values.
I just started using Sheets for this so I absolutely have no clue. Would really appreciate if someone could help me out.
Thanks for your time!
Issue:
It's a locale problem. The value coming from IMPORTXML is formatted as in United States locale, so your spreadsheet (which uses a different format) cannot convert it.
Solution #1. Changing locale:
If the spreadsheet locale is changed to United States or others with the same format (via selecting File > Spreadsheet settings and setting the mentioned locale), the retrieved value will be a number, and you can work with it without using any other formula.
Solution #2. Formula:
If changing the locale is not an option, one possible way to convert the value to a valid number in your locale is the following formula:
=SUBSTITUTE(SUBSTITUTE(RIGHT(A2;LEN(A2)-1);",";"");".";",")
Changing locale didn't work in my case. But I was able to split the number which google sheet isn't detecting as a real number. So split it with "," and "." and any currency sign you may have, and then combine individual values for desired output

Google spreadsheets - how to handle duration: store and use in calculations?

I've got a lot of "duration" values - basically a race duration - in a format m:ss.millis [4:03.810 for example].
Currently GS handles it as text, but I would like to use those values for comparison and create some statistics.
Is this possible? I have read this: How to format a duration as HH:mm in the new Google sheets but even though I have created a custom formats like:
or
but neither with one nor with another I cannot use those values for calculations. GS always complains about the values beeing stored as text.
I guess I'm just doing something wrong, but I definitely need to be able to provide values in this format and be able to use them in calculations.
How can I do that?
I regret that Duration seems to be a useless abomination and Sheets appears to offer no relatively easy way to convert text representation to values. Pending a better answer I suggest you convert all your durations as below:
=(left(A1,find(":",A1)-1)+right(A1,6)/60)/1440
format as Number:
mm:ss.000
and then apply your formulae.
(Change , to ; if required by your locale.)
A shorter formula might be used to cajole TIMEVALUE to work by including an hour value of 0:
=TIMEVALUE("00:"&A1)
A happy coincidence brought me back here because only very recently have I found that Google Sheets does offer a way to convert Text to Number (or I was having another aberration when I claimed otherwise). However, this still seems not to apply to Duration. Maybe there is yet hope though.

User input money value in grails

I need to get a money value from the user, but the user can type the number in different formats:
1.234.234,78
1234566,26
123,123,132.12
I don't know how to treat the variable.
I have to transform that value in Double type but if the user give me a value with "," the program generate an exception, how can I handle this?
If you want to handle money then I recommend you a great grails plugin with many feature for currencies handling and conversions etc.
Have a look at Currency plugin.
In your domain static constraints use matches with the regular expression that handles currency format.
Then using java.text.NumberFormat allows you to format double regardless of having comma in the input.

Properly formatting currency values based only on ISO4217 currency code?

I am using a web API that returns values like this:
{
"CNY": 42.0,
"DKK": 31337.00,
"EUR": 6789.01,
"GBP": 6502.00,
"USD": 12345.67,
...
}
I would like to format these values as proper currency values (e.g. for USD, "$12,345.67," for EUR, "6789.01€", for GBP, "£6502.00", for DKK, "31337.00 DKK", etc.) In other words, using the proper symbol ($, £, etc.), but also for some currencies, the symbol comes before the amount whereas for others, it comes after the amount, etc.
The catch is the API I am using only returns ISO4217 country codes ("USD," "EUR," "CNY," etc.) instead of locales. I know NSNumberFormatter has an NSNumberFormatterCurrencyStyle which looks like it does the proper formatting, but apparently the only way you can tell it what type of currency you're dealing with is by handing an NSLocale to its setLocale.
Is there any way to convert from ISO4217 currency codes to locales, other than hardcoding a ISO4217->locale conversion table in my code (which, granted, might work ok since ISO4217->locale mappings probably don't change very often??) Still, I would prefer a way of doing this programmatically if possible.
Of course you cannot map currency codes to locales - with the Euro this just must fail because there are probably 50 locales using Euro.
What you need to do is display the currency according to the locale of the user. Users in Germany, Britain, USA, can all display Euros, for example, and do it in different ways. Each locale can display all currencies.

.NET Currency exponent ISO_4217

I'm developing something for international use. Wondering if anyone can shed any light on whether the CultureInfo class has support for finding currency exponents for particular countries, or whether I need to feed this data in at the database level.
I can't see any property that represents this at the minute, so if anyone knows definitively if it exists, before I look for it / buy it from ISO.
Currency Exponent is the minor units of the currency.
http://en.wikipedia.org/wiki/ISO_4217 - e.g. UK is "2"
Take a look at this blog post on getting CultureInfo for a region. Basically, Window and .NET know about the user's region but not their currency. A region implies a currency, but a country can have more than currency. For example, a person in Cambodia would more than likely want to enter and use USD than Riel. If possible, when capturing any currency amount in a multi-currency system you should capture the currency ISO code.
If you just want to make a quick guess, you can create a CultureInfo object and use it's NumberDecimalDigits property. The also creates a problem when countries switch currencies. For example, if Belarus joins the EU, then it's currency would change from BYR to EUR. It's currency symbol and exponent will be out of date.
I looked at this question and provided a solution which may or may not meet your needs here: http://www.codeproject.com/KB/recipes/MoneyTypeForCLR.aspx#CurrencyType
The short of it: I implemented the ISO spec as a custom type using the spec itself to generate the values. Obviously this would need to be regularly updated in production...

Resources