Other Javascript methods and functions

Here we describe the various methods/functions that can be used with our Javascript:

  • The flux.get method
  • The flux.track method
  • Event listeners

The get method

The flux.get method can be used to retrieve resolved tokens that have been returned recently.

When tracking occurs, any resolveToken requests are returned and added to a resolvedTokens object.

The flux.get method accesses this object and returns the value.

For example, to get the current visitor ID:


To get current node ID:


And for any other tokens you have set in fluxOptions or sent in a view request manually:


The track method

The track method is for sending views and conversions.

These are detailed fully in their dedicated documents:

The two events are:

  { optional tracking attributes object }, 


  { conversion tracking attributes object }, 

Event listeners

FunnelFlux JS no longer required event listeners to guarantee sequencing of conversions.

However, you can still tap into our JS events to trigger other events.

Currently there are two available, examples below:

document.addEventListener('fluxView', function(){
  console.log('Flux view completed')
document.addEventListener('fluxConversion', function(){
  console.log('Flux conversion completed')

Or in the case of firing other functions:

document.addEventListener('fluxView', functionToCall)
document.addEventListener('fluxConversion', functionToCall)
Was this article helpful?