> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.funnelflux.pro/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Other Javascript methods and functions

The FunnelFlux JavaScript library includes utility methods beyond the core tracking setup. These let you read tracking data, send events, and react when tracking completes. This article covers three topics:
-   The `flux.get` method -- retrieve token values
-   The `flux.track` method -- send views and conversions
-   Event listeners -- react to tracking events

## The get method
Use `flux.get` to retrieve resolved tokens. Tokens are dynamic placeholders like `{visitor}` that the server replaces with actual values when tracking runs.

During tracking, the server resolves each requested token. It then stores the result in a local `resolvedTokens` object. Call `flux.get` to read a value from that object.

Get the current visitor ID:
```javascript
flux.get('{visitor}')
```
Get the current node ID:
```javascript
flux.get('{current-node-id}')
```
Get any other token you set in `fluxOptions` or sent in a view request:
```javascript
flux.get('{token-name}')
```
## The track method
Use `flux.track` to send page views and conversions. See these dedicated guides for details:
-   Tracking page views
-   Tracking conversions

The method supports two event types. To track a page view:
```javascript
flux.track('view',
  { optional tracking attributes object },
  optionalCallbackFunction
)
```
To track a conversion:
```javascript
flux.track('conversion',
  { conversion tracking attributes object },
  optionalCallbackFunction
)
```
## Event listeners
FunnelFlux JS no longer requires event listeners for conversion sequencing.

However, you can still listen for tracking events to run your own logic. The library fires two custom events:
- `fluxView` -- fires after a view call completes
- `fluxConversion` -- fires after a conversion call completes

Use them with an inline function:
```javascript
document.addEventListener('fluxView', function(){
  console.log('Flux view completed')
})
```
```javascript
document.addEventListener('fluxConversion', function(){
  console.log('Flux conversion completed')
})
```
Or pass a named function:
```javascript
document.addEventListener('fluxView', functionToCall)
```
```javascript
document.addEventListener('fluxConversion', functionToCall)
```