Problem/Motivation

To track a webform's events analytics and tracking services needs to insert custom JS snippets into a webform page's header and footer.

Proposed resolution

Create a handler that allows admins to insert HTML code into a page's header and footer based on a submissions states and conditional logic.

Because of the security implications of this handler, it will be implemented as an optional sub-module with dedicated permissions.

Remaining tasks

  • Create webform_embed_code.module
  • Create 'edit webform embed code'
  • Create WebformEmbedCodeHandler
  • Create 'webform_embed_code.manager' service.
  • Implement hook_page_attachments()
  • Implement hook_preprocess_html()
  • Write handler config scheme
  • Write handler template
  • Create test form.
  • Write tests.

Notes

  • Anything can be inserted in a page's header, and footer including script tags and css.
  • The security implications for this feature are the same as the webform module's JS/CSS injection.

User interface changes

New handler.

API changes

None

Data model changes

None

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Issue summary: View changes
jrockowitz’s picture

Assigned: jrockowitz » Unassigned
Status: Active » Postponed

Postponing since this is a new feature that is not absolutely needed...right now.

jrockowitz’s picture

Status: Postponed » Closed (won't fix)

If someone is interested in implementing or sponsoring this feature. Please reopen this ticket.