Hey guys! I'm trying to connect Singular as a new ...
# support
c
Hey guys! I'm trying to connect Singular as a new destination. I followed the documentation and managed to make the connection. However, when looking at Live Events, my events have a bad request error because there is no
context.os.name
. This field is empty, since the events are triggered by the web and not by Android or iOS. The event source is
Javascript SDK
What should I do?
Copy code
{
  "error": "Platform name is missing from context.os.name"
}
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
h
Use the user agent parser transformation which will add it to the payload
m
++ to what Redsquare said.
c
Hey! Thanks for your contribution! I added the transformation. So I should look at live events at the transformation, right? Because when I look at live events at my destination it keeps failing. How can I see if the events are being sent? Im looking at https://app.singular.net/#/react/testing-console at singular, but I cant see any event
h
can you look at live events on your singular destination
you should see the payload being sent to them
post however rudder transforms the payload to the singular schema
it may have an error message in that view
c
So I think my transformation is not being aplied, once the payload stills the same
h
your transform was on a different event - is it in play on all those events?
hang on
c
It should be aplied to all of the singular events
h
your augmenting it to a 'parsedUserAgent' property
you need to merge it directly into the context prop within the transform
the singular destination transform wont be looking for a 'parsedUserAgent' prop
if that makes sense
c
Got it! thanks for your help! I think it worked because the error has changed 😅 Do you know if is there a transformation that I can do to send these values in the payload?
Copy code
{
  "error": "Missing required value from \"context.device.advertisingId\""
}
Copy code
{
  "error": "Missing required value from \"context.device.attTrackingStatus\""
}
h
nope, not sure what those refer to (dont use singular)
m
Hi David, can you share the sample payload that you are sending and the destination id?
Hey! Sure Destination ID = 2XXy8hOasyAr98m3DIXtIekCpM2 sample payload { "type": "track", "event": "shipment_service_selected", "sentAt": "2023-11-01T145817.279Z", "userId": "myidherejustchanged", "channel": "web", "context": { "os": { "name": "", "version": "" }, "app": { "name": "RudderLabs JavaScript SDK", "version": "2.42.3", "namespace": "com.rudderlabs.javascript" }, "page": { "url": "myurlherejustchanged", "path": mypathherejustchanged", "title": "justchanged", "search": "", "tab_url": "justchanged", "referrer": "$direct", "initial_referrer": "$direct", "referring_domain": "", "initial_referring_domain": "" }, "locale": "pt-BR", "screen": { "width": 412, "height": 892, "density": 2.625, "innerWidth": 412, "innerHeight": 844 }, "traits": { "email": "justchanged", "user_id": "justchanged", "last_name": "justchanged", "company_id": "justchanged", "first_name": "justchanged" }, "library": { "name": "RudderLabs JavaScript SDK", "version": "2.42.3" }, "campaign": {}, "sessionId": justchanged, "userAgent": "Mozilla/5.0 (Linux; Android 13; SM-S916B Build/TP1A.220624.014; Beyond-Android 4.10.8) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/118.0.0.0 Mobile Safari/537.36" }, "rudderId": "justchanged", "messageId": "justchanged", "timestamp": "2023-11-01T145817.295Z", "properties": { "shipment_type": "expresso" }, "receivedAt": "2023-11-01T145817.301Z", "request_ip": "200.207.97.94", "anonymousId": "justchanged", "integrations": { "All": true }, "originalTimestamp": "2023-11-01T145817.273Z" }
So since the JS SDK is not sending these parameters (context.os.name), they seem to be empty.
c
Yes, I added this transformation to get the
context.os.name
Copy code
import { UAParser } from "@rs/userAgentParser/v1";

export function transformEvent(event, metadata) {
    const userAgent = event.context?.userAgent;
    if (userAgent) {
        const parser = new UAParser();
        const parsedUserAgent = parser.setUA(userAgent).getResult();
        event.context.os = parsedUserAgent.os;
        event.device = parsedUserAgent.device;
    }
    return event;
}
But now the problem is that context.device is empty and I have these errors
Copy code
{
  "error": "Missing required value from \"context.device.advertisingId\""
}
Copy code
{
  "error": "Missing required value from \"context.device.attTrackingStatus\""
}
m
Where are you seeing this error? In the transformation live events because i can only see the older errors.
h
if singular requires this then the rudder destination transform should really do the leg work - else each customer will have to go through this
c
At live events from destination, Ranganath
m
Do you want to jump into a quick call to debug?
c
sure 🙂
Raised the issue to the team and will let you know once I have an update.
c
Thank you so much for your help! 😄
m
Hey David, since these fields are required fields for Singular destination (see docs ). The team has decided to restrict access to Mobile alone (Remove the web cloud mode)