i’m moving from segment -> rudderstack the migrat...
# support
b
i’m moving from segment -> rudderstack the migration guide, regarding the Javascript SDK it says: > Update the object. RudderStack uses
rudderanalytics
as the global object library as compared to Segment’s
analytics
object. …but also: > ou can use the rest of your code without any changes as the RudderStack API is fully compatible with Segment. i’m not super well-versed in javascript. what i want to understand is: if, elsewhere in my code, i use
analytics.track
, do i need to change this to
rudderanalytics.track
? or not? hopefully not 🙂
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.
HI Chris, if you are using the CDN code then yes you will need to use rudderanalytics.track, rudderanalytics.page, rudderanalytics.identify instead of analytics.track, analytics.page, analytics.identify. Broadly if you have followed our docs verbatim to migrate from Segment then you should be good by making the above change. I would suggest you try this out in your test/dev website before making such changes to your production website.
b
thanks for that. it’d be a sweet feature to have an option to pass the loader to say “refer to me as `analytics`” instead of
rudderanalytics
. maybe there are (legal?) reasons you can’t but that’d be handy
m
Hi Chris, generally if you are using an IDE to update your code it is pretty straight forward to do a find and replace so not sure how useful this feature would be.
b
that is true, but not for the tags all over GTM 🙂
m
Oh ok. Will see if the team will be interested in taking it up.