Skip to content

Commit

Permalink
Querystring api doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
prabrishac authored and sayan-mitra committed Sep 8, 2020
1 parent e9731db commit fdfecbd
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,7 @@ For a detailed technical documentation and troubleshooting guide on the RudderSt

# [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#querystring-api)Querystring API

Rudder's Querystring API allows you to trigger `track`, `identify` calls using query parameters. If you pass the following parameters in the URL, then it will trigger the corresponding `track / identify` call.

`ajs_uid` : Will make a `rudderanalytics.identify()` call with `userId` having the value of the parameter value.

`ajs_aid` : Will make a `rudderanalytics.setAnonymousId()` call with `anonymousId` having the value of the parameter value.

`ajs_event` : Will make a `rudderanalytics.track()` call with `event` name as parameter value.

`ajs_prop_<property>` : If `ajs_event` is passed as querystring, value of this parameter will populate the `properties` of the corresponding event in the `track` call.

`ajs_trait_<trait>` : If `ajs_uid` is provided as querysting, value of this parameter will populate the `traits` of the `identify` call made.
Rudder's Querystring API allows you to trigger `track`, `identify` calls using query parameters. If you pass the following parameters in the URL, then it will trigger the corresponding sdk api call.

For example,

Expand All @@ -240,6 +230,20 @@ rudderanalytics.track("test event", {testProp: "prop1"});
rudderanalytics.setAnonymousId("abcde");
```

You may use the below parameters as querystring parameter and trigger the corresponding call.

`ajs_uid` : Will make a `rudderanalytics.identify()` call with `userId` having the value of the parameter value.

`ajs_aid` : Will make a `rudderanalytics.setAnonymousId()` call with `anonymousId` having the value of the parameter value.

`ajs_event` : Will make a `rudderanalytics.track()` call with `event` name as parameter value.

`ajs_prop_<property>` : If `ajs_event` is passed as querystring, value of this parameter will populate the `properties` of the corresponding event in the `track` call.

`ajs_trait_<trait>` : If `ajs_uid` is provided as querysting, value of this parameter will populate the `traits` of the `identify` call made.



# [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#adding-callbacks-to-standard-methods)Adding callbacks to standard methods

One can also define callbacks to common methods of `rudderanalytics` object. _**Note**_: For now, the functionality is supported for `syncPixel` method which is called in Rudder SDK when making sync calls in integrations for relevant destinations.
Expand Down

0 comments on commit fdfecbd

Please sign in to comment.