Open Graph "Price" and "ID" - facebook-opengraph

I'm trying to implement the Open Graph protocoll into my e-commerce. I have 2 alerts regarding problems to fix:
<< Property price is incorrectly formatted >>
Does it mean that I need to switch all the prices with "." to separate decimals instead of ","?
<< Products without "id" information can't be uploaded. Please check that this field is included for each product in a separate, labeled column. >>
This is something I don't really understand.
Any tips/suggestions?
Thank you a lot!

Related

How to get a valid Date as input from GUI

I have a school practical where users enter their date of birth in a TEdit on a TForm. The user will most likely enter the date according to their custom date settings, but I want to be able to convert any or at least most date formats to the one I have stored in a .mdb Access database. How do I get an accurate and valid date from the GUI as user input?
I know of the decodedate(Date, year, month, day) procedure, but what if the user enters the date differently than system settings or as is displayed in the TDBGrid connected to the .mdb database via an ADOConnection and ADOTable? Then the procedure will crash.
Be a help to the user instead of a pain:
Is "contains" meant literally, so the user can actually also enter dates with leading and/or trailing spaces? Such things occur, especially when copying texts from elsewhere. Trimming off such whitespaces is easy, so allow this. See trim()
Avoid generic error messages but instead make them as precise as possible:
Wrong length? Tell what you expect and what you got instead, i.e.: "Expected length: 10, but got 8 instead."
No delimiter at expected position? Tell so, i.e.: "Expected delimiter "/" as 5th letter, but got "3" instead."
Illegal month? Tell so, i.e: "Expected "1" or "01" thru "12" as month, but got "23" instead."
Try to collect multiple error messages at once, so the user can see all of his mistakes and fix them in one go, instead of being penalized again and again with just one message per take.
Detect patterns and make them restrictive:
Pos #1 is in ['0'.. '2'] and pos #2 thru #4 is in ['0'.. '9']? Looks like a year from which we can proceed:
Pos #5 is in ['/', '-', '.']?
Pos #6 is '0' and pos #7 is in ['1'.. '9']? Or pos #6 is '1' and pos #7 is in ['0'.. '2']?
...and so on. That way you can much better recognize which format has been chosen and you can give much more precise error messages. It will also lead to ambiguous input, such as 4/10/2016 from which you don't know if 4 is a day or a month.
Check against illegal dates: which months cannot have a 31th day? For February 29th see IsLeapYear()
Display the date according to what you recognized - this helps you and your user to make sure the recognition was correct. Ideally you have your three Integers of year, month and date and then convert them to text again, along with delimiters - the outcome should be in general the input you had to deal with.
Regular expressions are great in recognizing patterns and then accessing the found parts. However, it's a topic on its own and should only be used when known on its own. A regex for the format I used in this example would be /([0-2][0-9]{3})[/.-](0?[1-9]|1[0-2])[/.-](0?[1-9]|[12][0-9]|3[01])/ where you can easily access $1 as year, $2 as one or two digit month and $3 as one or two digit day. You "only" have to check against illegal dates.
As #AndreasReijbrand pointed out, a TDateTimePicker would be the correct method to receive a date as user input on a GUI. The TDateTimePicker does all the validation work for you. After much debate, we were eventually allowed to use it. I post this new answer with some important insights to the TDateTimePicker component:
The TDateTimePicker automatically changes to the local set date format of the pc. So validation of that is unnecessary.
Conversion of date display format (yyyy/mm/dd or yyyy-mm-dd) from the .mdb Access database to the TDateTimePicker and vice versa is unnecessary. This is also done automatically. (Starting to see why there was so much criticism for the original lack of use of this component.)
The DateTimePicker does not allow negative values or non-sensical values such as (0030/09/08 or 2003/89/89).

Facebook Pixel: mismatched content_id values - how to fix?

I would greatly appreciate some help with my current Facebook catalog ad predicament.
For a product with stock number 12345, our data feed brings it into the Facebook catalog as 616_12345 (the 616_ is consistent). This is the content_id.
To match the FB pixel content_id and track events, the stock number in the catalog needs to match the stock number on the site. So no events are being recorded.
I am managing the pixel and events through Google Tag Manager. I have set up a CSS selector that points to the stock number in an unordered list, but of course it just returns 12345.
Is there a way to create a variable in GTM that assumes a "616_" will be added before the stock number?
I've been told there is no way to remove that 616_ from the data feed - so this is the only option I can think of.
Thanks very much in advance!
Yes there is a way to create a variable in GTM - simple create "Constant" variable and set its' value to "616_". You can then reference this variable in your events and tags by simply using double curly brackets like so: {{VariableName}} . You can find detailed information here.

Google Data Studio filter combining two custom fields

I am trying to join data associated with two custom variables in the same Google Analytics dataset for a filter widget. We have institution names for older data in customVarValue2 and after GA changed the use of custom variables, newer data in Institution. I would like to be able to access all that data (back to October 2011) in one pageview chart and I think I can do that with a calculated field.
I saw on a post in the Data Studio forums that the logical operators don't work so I've been trying to do this with individual lines like so:
CASE
WHEN REGEXP_MATCH(customVarValue2, '.*Denmark.*') THEN 'Denmark!'
WHEN REGEXP_MATCH(Institution, '.*Denmark.*') THEN 'Denmark!'
ELSE 'Other'
END
The goal is to end up with one "Denmark!" field in the widget dropdown where all the data is combined from the two custom fields (customVarValue2 and Institution) to cover the whole date range. I can get it to work with one of the variables and it gives me the choice of "Denmark!" and "Other" with the appropriate date range for the custom variables that I used. But when I put both "WHEN" cases in, I only get "Other" showing in the widget dropdown. I would appreciate any advice you can give.
Thanks,
Sandy
The version below seems to work for me on a different case. Have you checked the case of the custom variable macthes?
CASE
WHEN REGEXP_MATCH(customVarValue2, '.Denmark.') OR REGEXP_MATCH(Institution, '.Denmark.') THEN 'Denmark!'
ELSE 'Other'
END

How to list unique values of a particular field in Kibana

I am having a field named rpc in my elasticsearch database and I am displaying it using Kibana. When I search in search bar of kibana like:
rpc:*
It display all the values of rpc field but I want to have only those value to be displayed which are unique.
I have been playing around with Kibana4 since a couple of weeks now. I find it intuitive and simple and the experience has been great till now. Following your question, I tried getting unique results via a Data Table visualization. Why? Because I personally find it easier to understand. Following are the steps:
1. Get unique count
Create the visualization (Visualize -> Data Table). First lets get
the count of how many unique entries we have for a particular field
(We will use this in the later part for verification). I'm using
clientip.raw but as I see, it will work just fine with any friendly
field name too.
2. Set the aggregation right
Set you aggregation back to count and have a Split Rows as follows. Not doing this will give you count 1 for each field value (since it is looking for unique counts) when you populate the table. Noteworthy part is setting the Top field to 0. Because Kibana won't let you enter anything else than a digit (Obviously!). This was the tricky part. Hit Apply and you'll get the results. Unique field values and the count of each of them.
3. Verification:
Going to the last page of the table, we see there are exactly 543 results. This is how I know it works.
What Next?
You save this visualization and add it to a Dashboard. There you can always check the request, query, response and other stats.
Just an addition to the above mathakoot answer.
For the user of newer version (which do not allow bucket size of 0 anymore) just set a value greater than the maximum number of result
And report the value in the Options>Per Page field
I am using Kibana 6 so the UI looks a bit different than the older answers here.
Here is what worked for me
Create a visualization from your query, I used a line graph type (don't think it matters)
Under Data, set metrics aggregation = "Unique Count" and set field to your field.
Set x-axis aggregation = "Terms" and set field to your field.
Set Size > your number of records
Under Metrics and Axes, disable drawing of the graph, circles, and labels (this really helps the UI not lag)
Run query and then click "Inspect" and download CSV
Data
Metrics & Axes
I wanted to achieve something similar but I'm stuck with Kibana 3.1.
I simply added a panel of type "TERMS" and configured its Field = User-agent and left everything else on default values. This gave me a nice bar chart with one bar for each User-agent.

salesforce.com matrix reports - more than 2 columns on row headings

I need to create a donor summary report that provides total donations by donor by year.
I need to provide
name address email yr1total yr2total etc...
It looks like salesforce only allows two columns in row headings and two columns in column headings. Is there a way to work around this
Or, is there a way to use the tabular report to do the same?
TIA
If donations is a single field on the donor's record, it seems like what you're looking to do is attempt to display two columns for the same data within a report. The best way to do this (well, outside of creating a master-detail relationship with a new custom object named "Donations") would to have formula fields for each of the donation years, and calculate the donation sums in each of them. That is, as long as you have a way of calculating the year of the donation.
I believe to get the best answer, more information is needed.
Something like this? This will work if your donation is a separate object that's linked to Account (I've used Tasks & Events linked to Accounts in my example).
Create a report in "Matrix format".
Drop Account Name on the left pane, Donation's Date on the columns.
Columns will default to days. Click the dropdown in the place where I have "Created Date" and select summarizing by year (of course fine-tune to whatever you need).
Check date ranges / filter criteria etc obviously if you don't see all data.
Click Show -> Hide details.
Drop your "Donation Amount" or similar field into place where "Record Count" is displayed. Use "Sum".
Optionally deselect Show -> Record Count.
Now you're mentioning that there are only 2 columns so you probably already tried this. Well, common trick is to cheat by using a formula field that would hold your data (separated by comma maybe?). Tabular report would require you to create some helper fields (1 per year) on Account and do some kind of rollup summaries, messy.
If it's for a dashboard you could play with summary report (it can have more groups than 2) and pick chart type table on the dashboard...

Resources