Skip to content

Commit f585da7

Browse files
authored
Merge pull request #2805 from segmentio/documenting-obfuscation-feature
Bundle Obfuscation [DOC-508]
2 parents f71fa6b + e61afdd commit f585da7

File tree

1 file changed

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

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,23 +487,23 @@ You can modify the `.load` method in Analytics.js (the second line of the snippe
487487

488488
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.
489489

490-
An example:
490+
For example:
491491

492492
```js
493493
analytics.load('writekey', { integrations: { All: false, 'Google Analytics': true, 'Segment.io': true } })
494494
```
495495

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).
496+
#### Bundle Obfuscation
497+
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.
498498

499-
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.
499+
For example:
500500

501501
```js
502-
onConsentDialogClosed(function(consentedTools){
503-
analytics.load('writekey', { integrations: consentedTools })
504-
})
502+
analytics.load('writekey', { obfuscate: true })
505503
```
506504

505+
The `obfuscate` value is `false` by default.
506+
507507

508508
## Retries
509509

0 commit comments

Comments
 (0)