Skip to content

Survey Complete

Fire whenever a user successfully completes a survey.

This event is fired when survey input is successfully received and processed. This is in contrast to survey_error which occurs when a submission is attempted but an error occurs and the survey input is not recieved and processed.

Javascript Code

// When:
// User successfully completes survey and survey input is sucessfully received and processed. Contrasts survey_error in which a submission is not recieved and processed. 

// Code:
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null });  // Clear the previous event_data object.
dataLayer.push({
  event: 'survey_complete',
  event_data: {
    identifier: '<identifier>', // REQUIRED | string | ex. cancel_subscription_flow, free_trial
    name: '<name>', // REQUIRED | string | ex. cancel_subscription_flow, free_trial
    type: '<type>' // REQUIRED | string | ex. survey, lead_generation
  }
});

Variable Definitions

Field Type Required Description Example Maximum Length
identifier string required The survey machine-readable name. This should be a unique value specific to this survey, if one exists. If one does not exist, this can also be populated with the same value as the name. cancel_subscription_flow, free_trial 100
name string required The survey human-readable name. This should be something that an analyst without a deep knowledge of the technical implementation of the site can easily identify the survey with. It should be lowercase snake_case. cancel_subscription_flow, free_trial 100
type string required The survey type. This will act as a filtering mechanism in reporting to enable analysts to view survey droppoff funnels. It can also act as an internal aid in firing additional events if necessary. For instance, lead-generating surveys require a generate_lead event to be fired alongside complete_survey, and that could be written into the logic based upon this field. survey, lead_generation 100