.triggerSubscribePopup()

Opens a Grow Subscribe Pop Up form.

The .triggerSubscribePopup() method lets you display Grow Pop Up forms that you’ve created in the Grow Publisher Portal. This method requires that:

  • The Pop Up form has been created in the Grow Publisher Portal.
  • The type is a Pop Up form (not a Spotlight Subscribe, Subscribe, or Manual Placement form). For detailed instructions, see How to Set Up Pop Up Subscribe in the Grow Help Center.

.triggerSubscribePopup() can be called multiple times per page. It will return an error if it can’t find the form (for example, if it was deleted or the ID mistyped) or if the form is not a Pop Up.

You can find the form’s ID by reading Finding a Pop Up Form’s ID in the Troubleshooting section.


Syntax

window.growMe.triggerSubscribePopup(parameters)

Parameters

Name Type Description
popupFormId string required

Specifies the ID of the Pop Up form in the Grow Publisher Portal.

Return Value(s)

  • None.

Example(s)

The following example will try to open a Grow Pop Up form with the specified ID. In case of an error, it will log the response to the console.

function openPopup() {
  try {
		window.growMe.triggerSubscribePopup({
            // Change the placeholder text to the Pop Up form's ID.
			popupFormId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
		})
  } catch (e) {
    // Logs the error to the console.
    console.log(e)
  }
}