51黑料不打烊

resetState resetstate

This function is designed mainly for A4T customers to help solve issues related to working with IDs on single page sites/screens or apps.

Use cases section-840b88a5cdb042488b340cad5d7b22a5

As an A4T customer who uses the ID service, you may want to use the visitor.resetState() function when you need to:

  • To pass a Supplemental Data ID (SDID), or any other ID, from one page or screen to another through a redirect. Normally, the ID service won鈥檛 pass this ID without this function.
  • Use code that only updates specific sections of a page or app via Ajax calls and you want to track those actions. For example, say you have a page where clicking on an object only loads or changes a special section. In this case, the ID service can鈥檛 request a different ID unless the page is reloaded. However, with visitor.resetState(), you can request a new ID under these conditions.

See the code samples below.

Syntax section-9e63503e178f4be28ac850abf44d6d91

Syntax: visitor.resetState( *state