String url, long activityGroupId) throws Exception {
// Request the service.
SpotlightRemote service = dfaServices.get(session, SpotlightRemote.class);
// Set spotlight activity structure.
SpotlightActivity spotActivity = new SpotlightActivity();
spotActivity.setId(0);
spotActivity.setName(activityName);
spotActivity.setActivityGroupId(activityGroupId);
spotActivity.setExpectedUrl(new URL(url).toString());
// The type ID for for a counter activity is 1. See GetActivityTypes.java
spotActivity.setActivityTypeId(1);
// The standard tag method type has an ID of 1. See GetTagMethodTypes.java
spotActivity.setTagMethodTypeId(1);
// Create the spotlight tag activity.
SpotlightActivitySaveResult spotlightActivityResult =
service.saveSpotlightActivity(spotActivity);