We use segment.com in our original implementation, which we wish to remain with.
I was able to easily fire an identify call/event with static events with an example, but, I’ll need to pull in database data such as UserID, email address etc. into each JS snippet.
Is using static events the correct way to do such, and will I just need to manually type in the dynamic binding code for each data I want to push through with the JS?
So I need to replace the number, name, email, plan etc. with dynamic data on login / sign up. I’ve tried replicating what I have working in static events in dynamic running JS from flow, but that isn’t working.
Damn. I’m trying really hard to do everything Wappler first for easier future maintainability- seems like this should be a relatively easy thing to do with the tools at Wappler disposal. Static Event is perfect for this I just don’t know if it’s possible to include dynamic data. @Teodor?
Although static events and dmx.parse would work for this use case, I would recommend you to use FLOW instead.
Create an app level flow with params such as ‘name’, ‘email’ etc. and add 1 step - Run Javascript. In that step call a custom JS function, and pass all the flow-params as params to this JS call.
In your JS function, configure the analytics code using those parameters.
Now, wherever you need to call this analytics code, in the onsucess or similar dynamic event, you can just run the FLOW and pass all required params from server connect or form.
This is pretty much same as using static event & dmx.parse, but its much easier to maintain since the heavy lifting can be done using the UI action pickers, and the code view remains cleaner.
I did check out FLOW, my problem being I have very limited JS knowledge at this point - I got a little lost with how to setup the JS parameters.
I tried adding and running the JS trigger ( as defined by Segment, and the same trigger that works 100% when using a static event) - but I kept getting errors, so put it down to my lack of knowledge as to how to create the JS snippet with the run JS action.
Thank you for your input, this guides me to know that using FLOW is the best way to do this - I just need to figure out the JS part, now!