Work in Progress: How to send data to Postcript

  • Create a new custom Data Output and select Manual Trigger Only

  • Follow the structure below for the function:

function output(userData, context) {
  const data = {
     "keyword": "KEYWORD", //replace with your keyword
     "origin": "website",
  return fetch(`${encodeURIComponent('<>')}`, {
      method: 'POST',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json',
        'Authorization': 'Bearer API KEY' //replace with your API KEY
      body: JSON.stringify(data)
    .then(response => response.json())
    .then(response => console.log('response', response))
  • Trigger on page complete of the page where the data is obtained

Last updated