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.getmethod -- retrieve token values - The
flux.trackmethod -- 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:
flux.get('{visitor}')
Get the current node ID:
flux.get('{current-node-id}')
Get any other token you set in fluxOptions or sent in a view request:
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:
flux.track('view',
{ optional tracking attributes object },
optionalCallbackFunction
)
To track a conversion:
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 completesfluxConversion-- fires after a conversion call completes
Use them with an inline function:
document.addEventListener('fluxView', function(){
console.log('Flux view completed')
})
document.addEventListener('fluxConversion', function(){
console.log('Flux conversion completed')
})
Or pass a named function:
document.addEventListener('fluxView', functionToCall)
document.addEventListener('fluxConversion', functionToCall)
Updated on: 05/05/2026
Thank you!
