Snippets Collections
    const slickTrack = document.querySelector(`.slick-track`);
    new MutationObserver((entries) => {
      entries.forEach((mutationRecord) => {
        if (photosSwipedOrButtonsCLicked) return;
        log('style has transition: ', mutationRecord.target.getAttribute('style').includes('transition'));
        if (mutationRecord.target.getAttribute('style').includes('transition')) {
          sendEvent(100322757);
          photosSwipedOrButtonsCLicked = true;
        } else {
          log('targeted mutation does not include transition style');
        }
      });
    }).observe(slickTrack, {
      attributes: true,
    }); 
const waitForSiblingElementToBeRemoved = (form) => {
    // This Element are where any errors would appear
    const input = form.querySelector(`input[type='submit']`);

    // This observer looks for the sibling of the input submit button that appears 
    // and then removes when the request is complete
    new MutationObserver((entries, observer) => {
      log('entries[0].removeNodes: ', entries[0].removedNodes);
      if (!entries[0].removedNodes[0]?.classList.contains('ajax-progress')) return; 
      observer.disconnect(); // should this be moved after sendEvent 
      window.setTimeout(() => {
        if (input.classList.contains('error')) return; 
        log('Email has been submitted');
        sendEvent('pjs_email_submitted');
      }, 0);
    }).observe(input.parentElement, { childList: true, subtree: true }); // should be actually have two separate observers for each input?
  };
window.optimizely.get('visitor')

// example of getting specific pjs segment (from tb440)
window.optimizely.get('visitor').custom['22521880007']
// Get the state of Optimizely campaigns and experiments
window["optimizely"].get("state");
window["optimizely"].push(activate);
star

Tue Apr 04 2023 19:48:17 GMT+0000 (Coordinated Universal Time)

#optimizely #mutation #observer
star

Fri Mar 24 2023 06:37:16 GMT+0000 (Coordinated Universal Time)

#optimizely #force #tracking #true
star

Fri Mar 24 2023 06:23:41 GMT+0000 (Coordinated Universal Time)

#optimizely #all #log
star

Thu Mar 09 2023 21:10:32 GMT+0000 (Coordinated Universal Time)

#visitor #data #info #optimizely
star

Fri Feb 10 2023 20:50:00 GMT+0000 (Coordinated Universal Time)

#optimizely #visitor #id
star

Thu Feb 09 2023 18:35:22 GMT+0000 (Coordinated Universal Time)

#optimizely #data
star

Tue Feb 07 2023 03:36:48 GMT+0000 (Coordinated Universal Time)

#optimizely
star

Tue Feb 07 2023 03:35:05 GMT+0000 (Coordinated Universal Time) https://docs.developers.optimizely.com/web/docs/activate

#optimizely
star

Tue Feb 07 2023 03:32:05 GMT+0000 (Coordinated Universal Time)

#optimizely
star

Tue Feb 07 2023 03:19:16 GMT+0000 (Coordinated Universal Time)

#optimizely #log
star

Tue Feb 07 2023 03:18:46 GMT+0000 (Coordinated Universal Time)

#optimizely #log
star

Tue Feb 07 2023 03:17:17 GMT+0000 (Coordinated Universal Time)

#optimizely #force
star

Tue Feb 07 2023 03:15:58 GMT+0000 (Coordinated Universal Time)

#draft #optimizely #force #public

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension