Learn how to specify custom analtyics events and evars for AEM Mobile apps

You can define and implement custom analytics events to supplement the predefined analytics events that are used in AEM Mobile apps. For example, you can create a custom event that tracks behavior such as analyzing how many users subscribed to a newsletter in an HTML article.

Use the Mobile Marketing Dashboard to define custom analytics events and new processing rules for those events. You can then send these custom analytics events from within HTML content.

 

Setup and requirements

Custom analytics is provided through the Mobile Marketing SDK. This requires an additional purchase through the Digital Marketing Cloud.

The user who configures the custom analytics events must be an admin for the report suite in Adobe Analytics. In addition, the admin must be authorized to edit Processing Rules. For more information about becoming authorized to edit processing rules, see Processing Rules and Become authorized to use processing rules.

The HTML content that sends custom events must have extensibility features enabled. This option is available when editing article properties in the On-Demand Services Portal.

Setting up custom analytics

The first step in setting up custom analytics is to define the custom analytics events and evars. This step requires analytics admin rights. The admin can set up custom analytics using either the Mobile Marketing Dashboard or the Adobe Analytics site.

Setting up custom analytics from the Mobile Marketing Dashboard

  1. Make sure that you have analytics admin rights and that you are authorized to edit Processing Rules as described above.

  2. Go to the Mobile Marketing Dashboard: https://mobilemarketing.adobe.com

  3. Create a new app, or select an app and choose Manage App Settings.

  4. Click Manage Variables & Metrics.

  5. Click Custom Metrics. Scroll down the list, and select an event number from the drop-down menu. Type an event name, and select a type from the drop-down menu (use Whole Number for most events).

  6. Click Custom Variables. Scroll down the list and select an evar number from the drop-down menu. Type an evar name. Select a persistence value from the drop-down menu (use Tracking Call for most evars).

  7. Click Save at the top of the page.

  8. In the On-Demand Services Portal, rebuild and resubmit your app.

    Whenever you change app settings in the Mobile Marketing Dashboard, you must rebuild your app in order for the changes to take place.

Setting up custom analytics from Adobe Analytics (Omniture)

  1. Make sure that you have analytics admin rights and that you are authorized to edit Processing Rules as described above.

  2. Go to the Adobe Analytics site: https://my.omniture.com/login/

  3. Click Admin, and then choose Report Suites.

  4. Select the report suite and click Edit Settings > Conversion > Success Events.

  5. Click Add New. Scroll to new event that was added to the list. Type an event name, and select the type (use Counter for most events). Click Save.

  6. Click Admin, and then choose Report Suites from the drop-down menu.

  7. Select the report suite and click Edit Settings > Conversion > Conversion Variables from the drop-down menu.

  8. Click Add New. Scroll to new evar that was added to the list. Set Status to Enabled. Type an evar name, and set Expire After (use Hit for most events). Click Save.

Defining processing rules

Once the admin defines the custom analytics events and evars, the admin must then add Processing Rules for the events and evars. The admin must be authorized to edit Processing Rules, as described earlier in this document.

  1. Make sure that you have analytics admin rights and that you are authorized to edit Processing Rules as described above.

  2. Go to the Adobe Analytics site: https://my.omniture.com/login/

  3. Click Admin, and then choose Report Suites.

  4. Select the report suite and click Edit Settings > General > Processing Rules from the drop-down menu.

  5. Open an existing rule for events or select Add Rule to create a new rule for events.

  6. Choose Add Action. Configure the action to set the custom event to 1 if the condition below is met. Configure the condition for a.action equals a user-define string to be used to send the event.

  7. Open an existing rule for evars or select Add Rule to create a new rule for evars

  8. Select Add Action. Configure the action to overwrite the custom evar with the evar to be used to send the event

  9. Click Save at the bottom of the page.

  10. In the On-Demand Services Portal, rebuild and resubmit your app.

    Whenever you change analytics settings in the cloud, rebuild your app in order for the changes to take place.

Adding custom events to HTML content

Once the custom analytics events, evars, and processing rules have been defined, edit the HTML content to send the custom events. In the HTML article, you need to include the Analytics SDK, enable extensibility features, and send the custom event.

Include the Analytics SDK

Include the following <script> tag in the <head> tag in the HTML content.

<script type="text/javascript" src="cordova.js"></script>

Enable extensibility features

When you create the article that includes the HTML content, make sure that you select the Enable extensibility features option in article properties.

Send the Custom Event

Configure the HTML content to send the custom event. The custom event is sent using the tracking methods described in this article:

https://marketing.adobe.com/resources/help/en_US/mobile/ios/phonegap_methods.html

The following are two examples.

ADB.trackAction("MyCustomEvent1",
                {"evar77":"user-defined value"},
                null,
                null);
  
OR
 
ADB.trackAction("MyCustomEvent2",
                {"evar78":"user-defined value"},
                null,
                null);

Summary of this example

In the example above, the HTML content is set up to send the following two custom events:

  • MyCustomEvent1
  • MyCustomEvent2

The MyCustomEvent1 uses evar77. The user passes information relevant to this event in this evar. Similarly, MyCustomEvent2 uses evar78.

The Processing Rule states that when MyCustomEvent1 and MyCustomEvent2 are received, then increment the count of the corresponding event. In addition, the Processing Rule states that the MyCustomEvent1 and MyCustomEvent2 should be overwritten with the values the user set in evar77 and evar78, respectively.

Lisensoitu Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License -lisenssin mukaan.  Creative Commons -lisenssien ehdot eivät koske Twitter™- ja Facebook-viestejä.

Lakisääteiset ilmoitukset   |   Online-tietosuojakäytäntö