I am currently writing an audioplayer with which YouTube videos can be played & controlled with hotkeys. However, I am having an issue: Videos that should be available for embedding get a "Not available" error for some reason.
An example of the embedding code:
<iframe width="560" height="315" src="https://www.youtube.com/embed/d6QE4EJrIFc" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
When I paste this into any random .html file and open it in my browser, I get the error stated above. However, when I paste the video in JSFiddle it can be embedded perfectly fine: https://jsfiddle.net/vnkLzh9r/3/
The above trick with JSFiddle is something I got from this StackOverflow answer.
As far as I am aware, there are no settings on YouTube to disalow embedding of videos on non-public domains, but yet that seems to be the problem here. Can anyone confirm if that is the underlying issue?
In addition, is there a way for me to embed these videos without having to rely on a public domain?
Update
Okay, I have put the iFrame in an Angular project and hosted the project with NG serve. Then I access the page with http://localhost:4200 and the iframe actually works & plays the video. For some reason, when I open the .html file with just the iframe in it, that the video does not want to play? In addition, I have the following debug info of the YT player:
{
"ns": "yt",
"el": "embedded",
"cpn": "nVMH8LozAhZ1QLVb",
"docid": "d6QE4EJrIFc",
"ver": 2,
"cmt": "0",
"ei": "uUlYXfnOCoLj-gbKsYSAAQ",
"fs": "0",
"rt": "311.975",
"euri": "",
"lact": 1,
"cl": "263586394",
"mos": 0,
"state": "80",
"volume": 77,
"c": "WEB_EMBEDDED_PLAYER",
"cver": "20190816",
"cplayer": "UNIPLAYER",
"cbr": "Firefox",
"cbrver": "68.0",
"cos": "Windows",
"cosver": "10.0",
"hl": "en_US",
"cr": "NL",
"len": "254",
"fexp": "23744176,23751767,23788875,23804281,23818122,23818585,23827085,23829162,23832308,23834462,9449243",
"size": "315:560",
"inview": "1",
"vct": "0.000",
"vd": "NaN",
"vpl": "",
"vbu": "",
"vpa": "1",
"vsk": "0",
"ven": "0",
"vpr": "1",
"vrs": "0",
"vns": "0",
"vec": "null",
"vvol": "0.77",
"creationTime": 313013,
"totalVideoFrames": 0,
"droppedVideoFrames": 0,
"corruptedVideoFrames": 0,
"debug_error": {
"errorCode": "auth",
"errorDetail": "0",
"errorMessage": "Video unavailable",
"Ph": "",
"Uz": "0"
},
"relative_loudness": "NaN",
"user_qual": "hd1080",
"debug_videoId": "d6QE4EJrIFc",
"0sz": false,
"op": "",
"yof": false,
"dis": "",
"gpu": "ANGLE_(NVIDIA_GeForce_GTX_1070_Ti_Direct3D11_vs_5_0_ps_5_0)",
"cgr": true,
"debug_playbackQuality": "unknown",
"debug_date": "Sat Aug 17 2019 20:44:08 GMT+0200 (Central European Summer Time)"
}
Related
We have migrated the UA to GA4. We use gtag.js for most of the events on the website and the Measurement Protocol for the purchase.
We noticed that the measurement protocol event has a problem with reporting at the sessions level on channels grouping because everything is classified as "not set", and we have a significant amount of purchases that are not linked to client_id. We are collecting a unique hit with the purchase (print screen attached).
We followed all the requirements on the documentation, and after discussions with other web analytics, it should be an issue with the Measurement Protocol.
We need your assistance to find a solution to this tracking problem.
url = "https://www.google-analytics.com//mp/collect?api_secret=API_Secrect&measurement_id=G-0000000000"
payload = {
"client_id": "685297041.1666940000",
"user_id": "#1234",
"non_personalized_ads": 'false',
"user_properties":{
"cust_numb":{
"value":"#1234"},
"internal_user":{
"value":"false"}},
"events": [
{
"name": "purchase",
"params": {
"items": [
{
"price": 3.35,
"quantity": 1,
"item_id": "#1062",
"item_name": "White Fine Filters",
"affiliation": "client.com",
"currency": "USD",
"discount": 0.5,
"item_variant": "NA",
"item_category": "Filters",
"item_brand": "Generic",
"index": 0,
"item_category2": "One_Time",
"item_category3": "simple_product",
"item_category4": "full_price",
"item_category5": "in stock"
},
{
"price": 15.95,
"quantity": 1,
"item_id": "#1068",
"item_name": "Black Filters for PR",
"affiliation": "client.com",
"currency": "USD",
"discount": 5.8,
"item_variant": "NA",
"item_category": "Supplies/Filters/Sale 2021",
"item_brand": "Generic",
"index": 1,
"item_category2": "one_time",
"item_category3": "simple_product",
"item_category4": "Discounted",
"item_category5": "in_stock"
}],
"affiliation": "",
"coupon": "ALL10",
"currency": "USD",
"transaction_id": "#2_02022",
"shipping": 5,
"tax": 0.35,
"value": 15,
"session_id": "1666947000",
"timestamp_micros": "1666948174531000",
"engagement_time_msec": "1000"
}
}
]
}
requests.post(url,data=json.dumps(payload))
enter image description here
I tested everything.
Could you let me know if you are facing the same issue?
I noticed this on the documentation, but it's not detailed what partial reporting is.
"Full Server-to-Server
While it is possible to send events to Google Analytics solely with measurement protocol, only partial reporting may be available. The purpose of the measurement protocol is to augment existing events collected via gtag, GTM, or Firebase. Some event and parameter names are reserved for use via automatic collection and cannot be sent through the measurement protocol."
Thank you,
The following HTTP request was sent and an HTTP 400 response was received. What is wrong with the request that caused it to fail?
POST /api/v2/organizations/4523jddfgd/projects HTTP/1.1
Host: www.reddit.com
Content-Type: application/json
Authorization: Bearer VALID_API_TOKEN
[
"name": "Project 1",
"package": "Standard",
"address": {
"street": "12456 Main St",
"city": "Dallas",
"zip": "75200",
"state": "TX",
"country": "USA"
}
]
This is an interview question, can you help guys ?
Have a look at the MDN wiki page about HTML status code 400.
Status code 400 points to a client side error e.g. malformed request body. Another reason could be that a required header is missing. As indicated in the MDN wiki page you should not attempt to send the very same request unmodified again as the result will be the same as it is not a server side issue.
What you should do instead is: consult the API documentation again and make sure that no header is missing and the request body is valid (i.e. valid JSON/ XML/ whatever in the correct structure).
Looking at your request I can see that the body is not valid JSON.
[
"name": "Project 1",
"package": "Standard",
"address": {
"street": "12456 Main St",
"city": "Dallas",
"zip": "75200",
"state": "TX",
"country": "USA"
}
]
This cannot be parsed, hence the error. An array cannot hold properties. What is missing is a { and } after the [ and before the closing ].
Using the following request body should work.
[
{
"name":"Project 1",
"package":"Standard",
"address":{
"street":"12456 Main St",
"city":"Dallas",
"zip":"75200",
"state":"TX",
"country":"USA"
}
}
]
EDIT
As #Evert pointed out, it is more likely that you need to replace [] with {} as POST requests are used to create single new resources. But the only way you can be absolutely sure is by reading the API documentation.
{
"name":"Project 1",
"package":"Standard",
"address":{
"street":"12456 Main St",
"city":"Dallas",
"zip":"75200",
"state":"TX",
"country":"USA"
}
}
I'm trying to post the the purchase order line details from postman using odata and I'm getting the following error.
{
"error": {
"code": "",
"message": "An error has occurred.",
"innererror": {
"message": "Write validation failed for table row of type 'PurchPurchaseOrderLineEntity'. Infolog: .",
"type": "Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataValidateWriteException",
"stacktrace": " at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.CreateEntity_Save(ChangeOperationContext context, ChangeInfo changeInfo)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.<>c__DisplayClass10_0.<CreateEntity>b__1(ChangeOperationContext context)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.TrySave(ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__3.MoveNext()"
}
}
}
I have tried checking these links but I'm not getting a breakthrough:
https://powerusers.microsoft.com/t5/Connecting-To-Data/Error-creating-order-line-in-Dynamics-365-for-Operations/td-p/11927
https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/378486/error-while-submitting-po-from-external-system-odata-d365-f-o
Below is my payload
{
"dataAreaId": "XXXX",
"LineNumber": 1,
"PurchaseOrderNumber": "XXXX-PO-000009",
"ReceivingSiteId": "1",
"LineDescription": "XXXXXXX XXXX XXXX",
"ItemNumber": "SKU0000012530",
"DIOTOperationType": "Blank",
"LineAmount": 9687.19,
"PurchasePriceQuantity": 1,
"PurchasePrice": 9687.19,
"PurchaseUnitSymbol": "EA",
"OrderedPurchaseQuantity": 1,
"DeliveryAddressName": "XXXXX XXXXX XXXX",
"ProcurementProductCategoryName": "XXXXXX XXXXX XXXX",
"ReceivingWarehouseId": "TG",
"VendorInvoiceMatchingPolicy": "ThreeWayMatch",
"RequestedDeliveryDate": "2021-09-03T12:00:00Z"
}
Anyone who can help me on this?
NB: The Purchase order header is working without any problem.
Despite the missing information in the question, I tried to reproduce the issue. My test setup was a 10.0.20 environment with contoso demo data. I used the DEMF company and created a new purchase order since the existing ones were either already invoiced and/or intercompany.
I created the new purchase order for vendor DE-001 and was able to create lines in it using an OData request sent by Postman.
While testing, I noticed that the response Postman receives does contain the infolog messages which are missing in the question. Either they were removed (in which case please [edit] the question and add them) or the version of D365 does not include them (in which case please [edit] the question to add the version information).
I also noticed that the payload in the question contains fields ItemNumber and ProcurementProductCategoryName. As far as I know, a purchase line can have only one of those two, but not both. If you manually create a line with either one, the other one will be locked for editing. So please retry your request without either the ItemNumber or the ProcurementProductCategoryName field.
For the record, here are the payloads that worked in my test setup:
Payload with procurement category
{
"dataAreaId": "DEMF",
"LineNumber": 1,
"PurchaseOrderNumber": "000011",
"ReceivingSiteId": "1",
"LineDescription": "XXXXXXX XXXX XXXX",
"ProcurementProductCategoryName": "PAYROLL",
"DIOTOperationType": "Blank",
"LineAmount": 47.11,
"PurchasePriceQuantity": 1,
"PurchasePrice": 47.11,
"PurchaseUnitSymbol": "EA",
"OrderedPurchaseQuantity": 1,
"DeliveryAddressName": "XXXXX XXXXX XXXX",
"ReceivingWarehouseId": "11",
"VendorInvoiceMatchingPolicy": "ThreeWayMatch",
"RequestedDeliveryDate": "2021-09-03T12:00:00Z"
}
Payload with item number
{
"dataAreaId": "DEMF",
"LineNumber": 1,
"PurchaseOrderNumber": "000009",
"ReceivingSiteId": "1",
"LineDescription": "XXXXXXX XXXX XXXX",
"ItemNumber": "D0001",
"DIOTOperationType": "Blank",
"LineAmount": 47.11,
"PurchasePriceQuantity": 1,
"PurchasePrice": 47.11,
"PurchaseUnitSymbol": "EA",
"OrderedPurchaseQuantity": 1,
"DeliveryAddressName": "XXXXX XXXXX XXXX",
"ReceivingWarehouseId": "11",
"VendorInvoiceMatchingPolicy": "ThreeWayMatch",
"RequestedDeliveryDate": "2021-09-03T12:00:00Z"
}
I'm trying to use the Here Fleet Telematics CalculateRoute.json service, to calculate trip costs (toll, etc). The sample page uses api_id and api_key for authentication. In my (Freemium) account, I don't see a way where I can generate that.
What I did is copy the request the sample site makes, and replace the app_id and app_key parameters with apikey=**key**. I also removed the jsoncallback parameter.
I get the back following JSON:
{
"faultCode": "s14e781b4-b577-4b58-86bb-359ee5c8a979",
"responseCode": "400",
"message": "The request is missing the app_id and app_code parameters. They must both be passed as query parameters. If you do not have app_id and app_code, please obtain them through your customer representative or at http://developer.here.com/myapps."
}
Update:
What I hope to achieve, is use the POST http method. According to https://developer.here.com/documentation/fleet-telematics/api-reference.html, section "Calculates a route with additional fleet telematics features", that should be possible.
The exact request message is (without actual api key):
POST https://fleet.ls.hereapi.com/2/calculateroute.json
Content-Type: application/json
{
"apiKey": "**SNIP**",
"waypoint0": "38.72639,-9.14949",
"waypoint1": "47.54881,7.58782",
"detail": "1",
"maneuverAttributes": "none",
"linkAttributes": "none,sh",
"legAttributes": "none,li",
"currency": "EUR",
"departure": "",
"tollVehicleType": "3",
"trailerType": "2",
"trailersCount": "1",
"vehicleNumberAxles": "3",
"trailerNumberAxles": "2",
"hybrid": "0",
"emissionType": "5",
"fuelType": "diesel",
"height": "4m",
"trailerHeight": "400",
"vehicleWeight": "12000",
"limitedWeight": "40t",
"disabledEquipped": "0",
"minimalPollution": "0",
"hov": "0",
"passengersCount": "1",
"tiresCount": "14",
"commercial": "1",
"heightAbove1stAxle": "1m",
"width": "2.55",
"length": "16.5",
"mode": "fastest;truck;traffic:disabled",
"rollups": "none,country;tollsys",
"alternatives": "1"
}
This returns the following:
HTTP/1.1 401 Unauthorized
Content-Type: application/json
Date: Mon, 01 Jun 2020 11:10:09 GMT
Server: nginx-clojure
Content-Length: 74
Connection: Close
{
"error": "Unauthorized",
"error_description": "Token or apiKey is missing."
}
Whereas, passing all the same values as url arguments in a GET request works.
You need to use the following endpoint:
https://fleet.ls.hereapi.com/2/calculateroute.json?apiKey={YOUR_API_KEY}&...
See Send a Request and Calculate Toll Cost documentation pages.
I'm setting up a multivariate test through Google Analytics. I created the experiment through the API, and everything is looking like its running, however, only the original is being selected and the variants aren't being served.
I've tried using incognito windows, and had a few other people visit the page as well, but everyone receives a page with ?utm_expid=XXXXXXXX-XX.YYYYYYYYYYYYYYYYYY.0 on the end, where the .0 seems to indicate "show original."
Any ideas why an experiment might always show the original? Here's my experiment as retrieved through the API.
{
"id": "YYYYYYYYYYYYYYYYYYYYY",
"kind": "analytics#experiment",
"accountId": "AAAAAAAA",
"webPropertyId": "UA-ZZZZZZZZZ-0",
"profileId": "XXXXXXXX",
"name": "Product Page - Grid Content",
"description": "Test of product page grid content.",
"created": "2013-11-22T15:53:32.634Z",
"updated": "2013-11-22T16:27:15.406Z",
"objectiveMetric": "ga:timeOnSite",
"optimizationType": "MAXIMUM",
"status": "RUNNING",
"startTime": "2013-11-22T16:00:37.367Z",
"rewriteVariationUrlsAsOriginal": true,
"winnerConfidenceLevel": 0.95,
"minimumExperimentLengthInDays": 7,
"trafficCoverage": 1,
"equalWeighting": true,
"variations": [{
"name": "Newest Products (Original)",
"url": "http://mystore.com/product/pastel-lipstick",
"status": "ACTIVE",
"weight": 0
}, {
"name": "Most Popular Products",
"url": "?",
"status": "ACTIVE",
"weight": 0
}, {
"name": "Related Products",
"url": "?",
"status": "ACTIVE",
"weight": 0
}],
"servingFramework": "REDIRECT",
"editableInGaUi": true
}
UPDATE:
I've suspected this might have something to do with those weight: 0 fields under variations[]. I'm not entirely sure why they appear as weight: 0, or whether that actually prevents variations from showing.
Originally, I wanted to set url: "?" for my variations because I wanted to avoid polluting my query string. Instead of using different URLs/query string variables to determine which variation to show, I used the utm_expid query string variable the GA Experiment redirect adds to determine which variation to show. Although the API accepted these URLs without issue, I'm not sure they're actually considered 'valid.' So I tried changing the URLs to be ?mvt=1 and ?mvt=2 respectively, and saw the weights changed to 0.3333 and variations serve.
Although changing the URL seems to work, does anyone have a thorough explanation for what or why this is happening?
There is an open issue on this https://code.google.com/p/analytics-issues/issues/detail?id=377. If you subscribe to that then you'll get notified when it's fixed.