3

I am trying access the Audience Manager Contacts in my DXA .Net application. I have followed the steps from SDL docs and able to create contacts using CME in Web 8 and also able to synchronize the contacts with the Subscription Management table using the Synchronize end Point micro service.

I have referenced the following two DLLs in the DXA Web site project to use the Audience Manager functions

  1. Sdl.AudienceManager.ContentDelivery.dll
  2. Tridion.OutboundEmail.ContentDelivery.dll

When trying to instantiate the Sdl.AudienceManager.ContentDelivery.Profile.Contact object. I am getting the following exception:

Unable to determine the current Publication. Please make sure the Ambient Data Framework is running, or configure a DefaultPublicationId in the cd_audience_manager_conf.xml configuration file

I have installed the Ambient framework in the Session enabled Content Service. Is there any config file I need to add in the DXA solution as per Tridion 2013 SP1 or the discovery service will handle this?

Please help!

Edit 1

I have modified and added the cd_Audience_Manager_Conf.xml in the DXA.

  <?xml version="1.0" encoding="UTF-8"?>
    <Configuration Version="8.1">  
    <Email>
      <OpenImage>MailOpened.gif</OpenImage>
    </Email>
    <Redirect> 
      <ErrorResolvingLink>Resolve.html</ErrorResolvingLink>   
      <ErrorResolvingBinary>Empty.gif</ErrorResolvingBinary>
      <GeneralError>Error.html</GeneralError>
      <AppendTrackingInfo>false</AppendTrackingInfo>
    </Redirect>
    <AmbientData>
       <CacheDuration>300</CacheDuration>
     </AmbientData>
     <Publications>
       <Publication Id="27">      
        </Publication>
      </Publications>
  </Configuration>

Apart from that I also tried to add cd_storage_conf.xml and the jars in the bbin\Lib folder in the DXA solution

<?xml version="1.0" encoding="UTF-8"?>
<Configuration Version="8.1">
    <Global>

        <Storages>
            <StorageBindings>
                <Bundle src="AudienceManagerDAOBundle.xml"/>
            </StorageBindings>
           <Storage Id="profiledb" Class="com.tridion.storage.persistence.JPADAOFactory" Type="persistence" dialect="MSSQL">
              <Pool CheckoutTimeout="120" IdleTimeout="120" MonitorInterval="60" Size="5" Type="jdbc"/>
              <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
                  <Property Name="serverName" Value="WSV001704"/>
                  <Property Name="portNumber" Value="1433"/>
                  <Property Name="databaseName" Value="tridion_submgmt"/>
                  <Property Name="user" Value="TMSSMUSER"/>
                  <Property Name="password" Value="Tridion!232!"/>
              </DataSource>
            </Storage>          

          <Storage Id="trackingdb" Class="com.tridion.storage.persistence.JPADAOFactory" Type="persistence" dialect="MSSQL">
            <Pool CheckoutTimeout="120" IdleTimeout="120" MonitorInterval="60" Size="5" Type="jdbc"/>
            <DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
                <Property Name="serverName" Value="WSV001704"/>
                <Property Name="portNumber" Value="1433"/>
                <Property Name="databaseName" Value="tridion_tracking"/>
                <Property Name="user" Value="TMSPSUSER"/>
                <Property Name="password" Value="Tridion!232!"/>
            </DataSource>
          </Storage>
        </Storages>
    </Global>

    <!-- Audience Manager type mappings -->
    <ItemTypes defaultStorageId="defaultFile">
        <Item typeMapping="AudienceManagerProfile" storageId="profiledb"/>
        <Item typeMapping="AudienceManagerTracking" storageId="trackingdb"/>
    </ItemTypes>
    <License Location="c:\SDLWeb\cd_licenses.xml"/>
</Configuration>

still I am getting the same error. Is there any other work around?

4
  • We have an Audience Manager integration scheduled on the backlog for DXA 1.6, that should arrive around Q3 2016 Jul 18, 2016 at 13:02
  • Do you see an info log line before that, stating something like "Unable to get Page Metadata for Url: ..."? Jul 18, 2016 at 13:11
  • @Peter: No there is not any info or Debug log before the exception related to this.
    – Manas.p
    Jul 19, 2016 at 5:12
  • No further info means that it could not get a ClaimStore from the ADF, so it suggests that that it is not properly configured. Jul 19, 2016 at 7:40

1 Answer 1

6

Audience Manager needs to know the current Publication. It can do that in one of two ways:

  1. Figure it out based on the current URL.
  2. Read a configuration setting that you've manually set.

When looking it up based on the URL, it first tries to extract the URL from the Ambient Data Framework (taf:request:full_url claim) and then looks up the page using the GetPageMetaByURL method of the DynamicMetaRetriever class.

If any of those steps fail, it will typically log the reason (i.e. unable to read the page metadata) and then fall back to option #2: reading the DefaultPublicationId setting from cd_audience_manager_conf.xml.

If not found, it has no way of knowing the current Publication and so cannot contact the right Audience Manager standalone service.

4
  • I have created a user registration form in DXA to store the contacts in subscription mgmt Table, which is not a Tridion Page. So the chance of getting the Page meta is very less. The second point to add a DefaultPublicationId in the cd_audience_manager_conf.xml. Can you help me in which section of the config file shall I add. As it seems the config file does not contain any section to configure the publication ID. Also where I will add this config file: In the DXA solution or in the Micro services?
    – Manas.p
    Jul 19, 2016 at 5:07
  • Add it under the root element, in the configuration file that is in your DXA solution. Jul 19, 2016 at 7:39
  • I have tried this and mentioned in the question. Is the cd_Audience_Manager_conf.xml file is correctly modified as per requirement. The xml is in the question.
    – Manas.p
    Jul 19, 2016 at 10:15
  • 1
    No, it's not correct. You've added a whole "Publications" section with sub-elements. The setting is literally called DefaultPublicationId and should only have the ID of the publication as text: <DefaultPublicationId>27</DefaultPublicationId> Jul 19, 2016 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.