Update tracking documentation and remove outbound link tracking option

- Commented out sections related to `window.rybbit.trackOutbound` in the documentation for clarity.
- Removed the `data-track-outbound` attribute from the script example in the tracker documentation.
- Updated the outbound links section in the web documentation to improve readability.
This commit is contained in:
Bill Yang 2025-05-07 11:41:47 -07:00
parent 330b211962
commit 2028d28246
3 changed files with 5 additions and 14 deletions

View file

@ -32,7 +32,7 @@ Tracks a pageview. Useful when `data-track-spa` is set to `"false"` or when you
window.rybbit.pageview();
```
### `window.rybbit.trackOutbound(url, text, target)`
{/* ### `window.rybbit.trackOutbound(url, text, target)`
Manually tracks outbound link clicks. Useful for programmatic navigation or custom link handling.
@ -42,7 +42,7 @@ Manually tracks outbound link clicks. Useful for programmatic navigation or cust
```javascript
// Track a programmatic navigation to an external site
window.rybbit.trackOutbound("https://example.com", "Example Site", "_blank");
window.rybbit.trackOutbound("https://example.com", "Example Site", "_blank"); */}
```
## Typescript Support
@ -62,14 +62,6 @@ interface Rybbit {
* @param properties Optional properties for the event
*/
event: (name: string, properties?: Record<string, any>) => void;
/**
* Tracks an outbound link click
* @param url The URL of the outbound link
* @param text The link text
* @param target The link target
*/
trackOutbound: (url: string, text?: string, target?: string) => void;
}
declare global {
@ -78,4 +70,4 @@ declare global {
}
}
export {};
export {};

View file

@ -92,7 +92,6 @@ The delay (in milliseconds) before tracking a pageview after URL changes via the
data-skip-patterns='["/admin/**", "/preview/*"]'
data-mask-patterns='["/users/*/profile", "/orders/**"]'
data-track-query="false"
data-track-outbound="true"
data-debounce="300"
></script>
```

View file

@ -139,7 +139,7 @@ function addToCart(item) {
}
```
## Tracking Outbound Links
{/* ## Tracking Outbound Links
Outbound links (links to external domains) are tracked automatically by default if `trackOutboundLinks` is enabled. The SDK attaches a global click listener to capture clicks on `<a>` tags with external `href` attributes.
@ -171,7 +171,7 @@ document.getElementById("external-service-button")?.addEventListener("click", ()
// Optionally navigate after tracking
window.open(url, "_blank");
});
```
``` */}
## Path Matching