ÃÛ¶¹ÊÓƵ

Creating ÃÛ¶¹ÊÓƵ Campaign Forms in AEM creating-adobe-campaign-forms-in-aem

AEM lets you create and use forms that interact with ÃÛ¶¹ÊÓƵ Campaign on your website. Specific fields can be inserted into your forms and mapped to the ÃÛ¶¹ÊÓƵ Campaign database.

You can manage new contact subscriptions, unsubscriptions, and user profile data, all while integrating their data into your ÃÛ¶¹ÊÓƵ Campaign database.

To use ÃÛ¶¹ÊÓƵ Campaign forms in AEM, you need to follow these steps, described in this document:

  1. Make a template available.
  2. Create a form.
  3. Edit form content.

Three types of forms, specific to ÃÛ¶¹ÊÓƵ Campaign, are available by default:

  • Save a profile
  • Subscribe to a service
  • Unsubscribe from a service

These forms define a URL parameter that accepts the encrypted primary key of an ÃÛ¶¹ÊÓƵ Campaign profile. Based on this URL parameter, the form updates the data of the associated ÃÛ¶¹ÊÓƵ Campaign profile.

Although you create these forms independently, in a typical use case, you generate a personalized link to a form page inside the newsletter content, so that recipients can open the link and make adjustments to their profile data (whether unsubscribing, subscribing, or updating their profile).

The form automatically updates based on the user. See Editing Form Content for more information.

Making a Template Available making-a-template-available

Before being able to create forms that are specific to ÃÛ¶¹ÊÓƵ Campaign, you must make the different templates available in your AEM application.

To do this, see the Templates documentation.

Creating a Form creating-a-form

First of all, check the connection between the author and publish instances and ÃÛ¶¹ÊÓƵ Campaign is working. See Integrating with ÃÛ¶¹ÊÓƵ Campaign Standard or Integrating with ÃÛ¶¹ÊÓƵ Campaign Classic.

NOTE
Make sure the acMapping property on the page’s jcr:content node is set to mapRecipient or profile when using ÃÛ¶¹ÊÓƵ Campaign Classic or ÃÛ¶¹ÊÓƵ Campaign Standard, respectively
  1. In AEM, in Sites, navigate to where you want to create a page.

  2. Create a page and select ÃÛ¶¹ÊÓƵ Campaign Classic Profile or ÃÛ¶¹ÊÓƵ Campaign Standard Profile and click Next.

    chlimage_1-43

    note note
    NOTE
    If the desired template is not available, see Template Availability.
  3. In the Name field, add the name of the page. It must be a valid JCR name.

  4. In the Title field, enter a title and click Create.

  5. Open the page and select Open Properties and in Cloud Services add the ÃÛ¶¹ÊÓƵ Campaign configuration and select the checkmark to save your changes.

    chlimage_1-44

  6. On the page, in the Form Start component, select the type of form it is - Subscribe, Unsubscribe, or Save Profile. You can only have one type per form. You can now edit the form’s content.

Editing Form Content editing-form-content

Forms dedicated to ÃÛ¶¹ÊÓƵ Campaign have specific components. These components have an option to let you link each field of the form to a field in the ÃÛ¶¹ÊÓƵ Campaign database.

NOTE
If the desired template is not available, see Making a template available.

This section only details specific links to ÃÛ¶¹ÊÓƵ Campaign. For more information on a more general overview of how to use forms in ÃÛ¶¹ÊÓƵ Experience Manager, see Editmode components.

  1. Select Open Properties and in Cloud Services add the ÃÛ¶¹ÊÓƵ Campaign configuration and select the checkmark to save your changes.

    chlimage_1-45

  2. On the page, in the Form Start component, click the Configuration icon.

    chlimage_1-46

  3. Click the Advanced tab and select the type of form it is - Subscribe, Unsubscribe, or Save Profile and click OK. You can only have one type per form.

    • ÃÛ¶¹ÊÓƵ Campaign: Save profile: lets you create or update a recipient in ÃÛ¶¹ÊÓƵ Campaign (default value).
    • ÃÛ¶¹ÊÓƵ Campaign: Subscribe to Services: lets you manage the subscriptions of a recipient in ÃÛ¶¹ÊÓƵ Campaign.
    • ÃÛ¶¹ÊÓƵ Campaign: Unsubscribe from Services: lets you cancel the subscriptions of a recipient in ÃÛ¶¹ÊÓƵ Campaign.
  4. You must have an Encrypted Primary Key component on each form. This component defines which URL parameter is used to accept the encrypted primary key of an ÃÛ¶¹ÊÓƵ Campaign profile. In Components, select ÃÛ¶¹ÊÓƵ Campaign so only those componente are visible.

  5. Drag the component Encrypted Primary Key to the form (anywhere) and click the Configuration icon. In the ÃÛ¶¹ÊÓƵ Campaign tab, specify any name for the URL parameter. Click the check mark to save your changes.

    Generated links to this form need to use this URL parameter and assign it the encrypted primary key of an ÃÛ¶¹ÊÓƵ Campaign profile. The encrypted primary key must be properly URL (percent) encoded.

    chlimage_1-47

  6. Add components to the form as needed, such as a Text field, Date field, Checkbox field, Option field, and so on. See ÃÛ¶¹ÊÓƵ Campaign Form Components for more information on each component.

  7. Click the Configuration icon to open the component. For example, in Text Field (Campaign) component, change the title and text.

    Click ÃÛ¶¹ÊÓƵ Campaign to map the form field to an ÃÛ¶¹ÊÓƵ Campaign metadata variable. When you submit the form, the mapped field is updated in ÃÛ¶¹ÊÓƵ Campaign. Only fields with matching types are available in the variable picker (for example, string variables for text fields).

    chlimage_1-48

    note note
    NOTE
    You can add/remove fields that are displayed in the recipient table by following the instructions here:
  8. Click Publish Page. The page is activated on your site. You can view it by going to your AEM publication instance. You can also test a form.

    note caution
    CAUTION
    You need to provide read permisssions to the anonymous user on the cloud service to use forms on publish. However, be aware of the potential security issues with providing read permissions to the anonymous user and be sure to mitigate it by, for example, configuring the dispatcher.

Testing a Form testing-a-form

After you create a form and edit form content, you may want to manually test that the form is working as expected.

NOTE
You must have an Encryted Primary Key component on each form. In Components, select ÃÛ¶¹ÊÓƵ Campaign so only those componente are visible.
Although in this procedure you enter the epk number manually, in practice, users would get a link to this page (whether to unsubscribe, subscribe, or update your profile) within a newsletter. Based on the user, the epk automatically updates.
To create that link, you use the variable Main resource identifier(ÃÛ¶¹ÊÓƵ Campaign Standard) or Encrypted identifier (ÃÛ¶¹ÊÓƵ Campaign Classic) (for example, in a Text & Personalization (Campaign) component), which links to the epk in ÃÛ¶¹ÊÓƵ Campaign.

To do this, you need to manually get the EPK of an ÃÛ¶¹ÊÓƵ Campaign profile and then append it to the URL:

  1. To get the encrypted primarly key (EPK) of an ÃÛ¶¹ÊÓƵ Campaign profile:

    • In ÃÛ¶¹ÊÓƵ Campaign Standard - Navigate to Profiles and Audiences > Profiles, which lists the existing profiles. Make sure the table displays the Main Resource Identifier field in a column (This can be configured by clicking/tapping Configure list). Copy the main resource identifier of the desired profile.
    • In ÃÛ¶¹ÊÓƵ Campaign Classic, go to Profiles and Targets > Recipients, which lists the existing profiles. Make sure the table displays the Encrypted identifier field in a column (This can be configured by right-clicking on an entry and selecting Configure list…). Copy the encrypted identifier of the desired profile.
  2. In AEM, open the form page on the publish instance and append the EPK from step 1 as a URL parameter: use the same name that you previously defined in the EPK component when authoring the form (for example: ?epk=...)

  3. The form can now be used to modify the data and subscriptions associated to the linked ÃÛ¶¹ÊÓƵ Campaign profile. After you modify some fields and submit the form, you can verify inside ÃÛ¶¹ÊÓƵ Campaign that the appropriate data has been updated.

The data in the ÃÛ¶¹ÊÓƵ Campaign database is updated once a form is validated.

recommendation-more-help
19ffd973-7af2-44d0-84b5-d547b0dffee2