4

Just wondering if there is a way of getting the <tridion:IncrementKey runat="server"> Profiling and Personalisation tracking working with Dynamic Component Presentations?

I have been struggling to get this working so have tried going back to basics to try and figure out where I have gone wrong. So started again and have used the example given on live content here to output the DCP but still no luck. It outputs the presentation but misses off the <tridion:IncrementKey runat="server"> part.

<%@Page language="C#"%>
<%@ Import Namespace="Tridion.ContentDelivery.DynamicContent"%>
<%
    ComponentPresentationAssembler componentPresentationAssembler = null;
    componentPresentationAssembler = new ComponentPresentationAssembler("[%=Page.ID%]",Page);
    int publicationId = 1;
    string component = "tcm:" + publicationId + "-" + Request.QueryString["ComponentId"];
    string template  = "tcm:" + publicationId + "-" + Request.QueryString["ComponentTemplateId"] + "-32";
%>
<html>
    <head>
        <title>Dynamic Component Link Destination Page</title>
    </head>
    <body>
        Assembled Component:
        <%Response.Write(componentPresentationAssembler.GetContent(component, template));%>
    </body>
</html>
<%
    componentPresentationAssembler.Dispose();
%>

I don't believe it's the Component Template that is wrong as if I add it to the page manually (using the CM) the output looks OK with all the <tridion:IncrementKey runat="server"> added as expected.

But I attach a screen shot of the settings just for sanities sake

enter image description here

Then in the Compound Template I just have the following TBBs in the following order

  1. My custom dreamweaver TBB (stripped back test code below)
  2. Activate Tracking (default template)
  3. Default Finishing Actions (default template)

The template building block above is just the following line of code (again stripped back to try and get it working)

<!--Adding hidden component @@Component.ID@@ -->

I also added the Activate Tracking TBB to the Page Template to try and make sure but again no joy.

I imagine this is going to be one of those issues where there is something easy I've missed but at the moment I can't see where it is.

Thanks for reading!

  • Did you add the proper target group to the 'tracked categories' in the Template? – MDa Feb 18 '15 at 13:28
2

Is the component presentation stored in the broker database?

The code you are listing

<tridion:IncrementKey runat="server">

will not be executed by the ComponentPresentationAssembler if the source is in the database; DCPs with ASP.Net server side code must be located on the filesystem for their code to be executed (in an SDL Tridion Content Delivery out-of-the-box situation; you can create virtual path providers and have code executed that is stored in the database but that is a customization on your part!).

I'd also point you to a check list for enabling profiling and personalization; seeing how you want to use REL I'd expect your tag to have the "tcdl" prefix but I'm not sure if there is Renderer support for Tridion profiling and personalization...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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