Skip to content

Commit e499ce1

Browse files
authored
Update index.md
1 parent 9a62f82 commit e499ce1

File tree

1 file changed

+15
-4
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+15
-4
lines changed

src/connections/sources/catalog/libraries/website/javascript/index.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,19 +483,19 @@ Destination flags are **case sensitive** and match [the destination's name in th
483483

484484
### Load Options
485485

486+
> info ""
487+
> **Note:** To use this feature, you must be on snippet version 4.1.0 or later. You can get the latest version of the snippet [here](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet).
488+
486489
You can modify the `.load` method in Analytics.js (the second line of the snippet) to take a second argument. If you pass an object with an `integrations` dictionary (matching the format [above](#selecting-destinations-with-the-integrations-object)), then Segment only loads the integrations in that dictionary that are marked as enabled with the boolean value `true`.
487490

488491
You can only call `.load` on page load, or reload (refresh). If you modify the `.load` method between page loads, it does not have any effect until the page is reloaded.
489492

490-
An example:
493+
For example:
491494

492495
```js
493496
analytics.load('writekey', { integrations: { All: false, 'Google Analytics': true, 'Segment.io': true } })
494497
```
495498

496-
> info ""
497-
> **Note:** To use this feature, you must be on snippet version 4.1.0 or later. You can get the latest version of the snippet [here](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet).
498-
499499
This way, you can conditionally load integrations based on what customers opt into on your site. The example below shows how you might load only the tools that the user agreed to use.
500500

501501
```js
@@ -504,6 +504,17 @@ onConsentDialogClosed(function(consentedTools){
504504
})
505505
```
506506

507+
#### Bundle Obfuscation
508+
You can also add an `obfuscate` property to the object in the second parameter, which obscures the URL from which your integrations and destination actions are loaded. This helps prevent words that are flagged by ad blockers to not be detected in your URL, enabling the integration to properly load.
509+
510+
For example:
511+
512+
```js
513+
analytics.load('writekey', { obfuscate: true })
514+
```
515+
516+
The `obfuscate` value is `false` by default.
517+
507518

508519
## Retries
509520

0 commit comments

Comments
 (0)