Permalink
Browse files

Updated readme for request-based opt-out

  • Loading branch information...
1 parent 22f8f78 commit 1eeb2d41d8bb04124d71ec3fe2df03b0527da8c4 @ketzusaka committed Sep 26, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 README.md
View
@@ -129,6 +129,20 @@ Where **options** is a Hash that accepts the following keys:
@mixpanel.append_api("identify", "Unique Identifier")
```
+### Prevent middleware from inserting code
+*Note*: Only applies when [Rack Middleware](#rack-middleware) is setup.
+
+Occasionally you may need to send a request for HTML that you don't want the middleware to alter. In your AJAX request include the header "SKIP_MIXPANEL_MIDDLEWARE" to prevent the mixpanel code from being inserted.
+
+```javascript
+$.ajax("/path/to/api/endpoint", {
+ headers: {"SKIP_MIXPANEL_MIDDLEWARE": true},
+ success: function(data) {
+ // Process data here
+ }
+});
+```
+
## Examples
### How to use it from Rails controllers?

0 comments on commit 1eeb2d4

Please sign in to comment.