You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a webpage that is sometimes embedded in a native app (webview). I want to utilise this package to send all events via the native app.
Why: I think it would be better if the native app can attach context about device ID (etc) rather than relying on cookies/id's set in the webview (our GA struggled with this)
Problem
The tracking implemented for the webpage uses Snowplow.addPlugin, but this package does not support addPlugin. How do/should I work around this?
Solutions
Plugin
Initially I thought I could create a plugin that forwarded all events to this packages trackSelfDescribingEvent. However the information received in beforeTrack and/or afterTrack does not appear to be trivial to convert back into Snowplow.trackPageView(...) or Snowplow.trackSelfDescribingEvent(..) (atleast I don't think it is trivial).
Wrapping
The second option I see would be to create a custom wrapper around Snowplow.trackSelfDescribingEvent(...) that also calls the trackSelfDescribingEvent from this package. It seems a bit hacky, so I wanted to hear if there was a better way to do this.
My preferred solution would be the plugin approach, but I'm open to any suggestions.
I also think I would need a way to stop the original event from being tracked, so that I do not create duplicate events. I guess I could get around this by setting the collector url to a non-existing url.
The text was updated successfully, but these errors were encountered:
Thanks @AndersCan for raising this and sorry for the late reply, this issue has fallen through the cracks.
Adding plugins to the WebView tracker would be a bigger piece of work. However, I do like your idea to pass events from the JavaScript tracker to the WebView tracker using the afterTrack callback in plugins. We could provide the integration in this tracker package and it would be a very nice way to make use of all the features of the JavaScript tracker in the WebView tracker.
I ended up creating a plugin that converted events back to their original form and then sent them to this plugin. To avoid sending double events, I set the collector url to https://localhost:4004
Context
I have a webpage that is sometimes embedded in a native app (webview). I want to utilise this package to send all events via the native app.
Why: I think it would be better if the native app can attach context about device ID (etc) rather than relying on cookies/id's set in the webview (our GA struggled with this)
Problem
The tracking implemented for the webpage uses
Snowplow.addPlugin
, but this package does not supportaddPlugin
. How do/should I work around this?Solutions
Plugin
Initially I thought I could create a plugin that forwarded all events to this packages
trackSelfDescribingEvent
. However the information received inbeforeTrack
and/orafterTrack
does not appear to be trivial to convert back intoSnowplow.trackPageView(...)
orSnowplow.trackSelfDescribingEvent(..)
(atleast I don't think it is trivial).Wrapping
The second option I see would be to create a custom wrapper around
Snowplow.trackSelfDescribingEvent(...)
that also calls the trackSelfDescribingEvent from this package. It seems a bit hacky, so I wanted to hear if there was a better way to do this.My preferred solution would be the plugin approach, but I'm open to any suggestions.
I also think I would need a way to stop the original event from being tracked, so that I do not create duplicate events. I guess I could get around this by setting the
collector
url to a non-existing url.The text was updated successfully, but these errors were encountered: