RudderStack's Querystring API lets you trigger the track
and identify
calls using the query parameters within the URL.
Query parameters
The query parameters are listed in the following table:
Parameter | Action |
---|---|
ajs_uid | Triggers a rudderanalytics.identify() call with userId having the parameter value. |
ajs_aid | Triggers a rudderanalytics.setAnonymousId() call with anonymousId having the parameter value. |
ajs_event | Triggers a rudderanalytics.track() call with event name as the parameter value. |
ajs_prop_<property> | If ajs_event is passed as a query string, the value of this parameter populates the properties of the corresponding event in the track call. |
ajs_trait_<trait> | If ajs_uid is provided as a query sting, the value of this parameter will populate the traits of the identify call made. |
Use-case
For the following URL containing the querystring parameters:
http://hostname.com/?ajs_uid=12345&ajs_event=test%20event&ajs_aid=abcde&ajs_prop_testProp=prop1&ajs_trait_name=Firstname+Lastname
The following API calls will be triggered:
rudderanalytics.setAnonymousId("abcde");rudderanalytics.identify("12345", { name: "Firstname Lastname" });rudderanalytics.track("test event", { testProp: "prop1" });
Contact us
For more information on any of the sections covered in this guide, you can contact us or start a conversation in our Slack community.
If you come across any issues while using this SDK, feel free to submit them on our GitHub issues page.