3

I would like to ask if it's possible to simulate the visit and the conversion of an experiment from an external service. That is, when my page renders, invoke a call to increase the visit or simulate the intermediate link used by SDL to add a new conversions. How SmartTarget generate data parameter in intermediate link? If yes, how could it be done? I have seen there is a api "smarttarget_api_extension.jar" but I can't find any documentation about it.

Thanks a lot for you help!!

Sergio.-

  • There are a couple of different approaches, so let me ask you this: do you want to keep using whatever analytics system is currently configured (e.g. Google Analytics) and just increase the views and conversions artificially? Or are you simply looking to generate fake/controlled statistics for viewing purposes (e.g. when a user views an Experiment, you control how many views and conversions it reports having)? – Peter Kjaer Jul 27 '18 at 9:16
  • It could be the first one. I would like to know how I can increase a view or a conversion. – Sergio G Jul 27 '18 at 10:05
  • I see. Java or .NET? – Peter Kjaer Jul 27 '18 at 10:16
3

You can track views and conversions using the AnalyticsManager in the com.tridion.smarttarget.analytics package. You do that by calling AnalyticsManager.getConfiguredAnalyticsManager() and then calling either trackView or trackConversion on it.

As you might expect, you will need to pass in some parameters. The first being the ExperimentDimensions - which holds all of the information regarding the Experiment being tracked and the Component Presentation it is showing - and the second is a map of any additional metadata that you wish to pass to the configured analytics provider. That map can be created with the default values by calling AnalyticsMetaData.fromRequest(request, request.getSession()) (where request is the current HttpServletRequest).

To create the ExperimentDimensions, you can simply call the default constructor. Be sure to then call all of the setter methods available on it (setExperimentId, setRegion, setComponentId, etc.), with whatever data you want to use.

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.