Home > database >  Can you specify your own attribute used to name a tap/click action in DataDog React Native SDK?
Can you specify your own attribute used to name a tap/click action in DataDog React Native SDK?

Time:11-25

The DataDog docs states that

Starting with version 2.16.0, with the actionNameAttribute initialization parameter, you can specify your own attribute that is used to name the action.

Thus you can have something like this in the DD configuration constructor:

DD_RUM.init({
    ...
    trackInteractions: true,
    actionNameAttribute: 'itemID',
    ...
})

Now both attributes itemID and data-dd-action-name can be used to name tap/click actions; data-dd-action-name is favored when both attributes are present on an element.

However that seems to be the case only for the browser SDK, and not the React Native SDK. Is this really the case?

CodePudding user response:

data-dd-action-name is currently the only way to specify the target name of an action using the RUM React Native SDK.

Depending on your use case you may can also use the DdRum.addAction() and DdRum.startAction() methods for manual action tracking and provide the desired target name. There is an example of calling these methods in the Manual Instrumentation section of the RUM React Native SDK documentation.

  • Related