We have an email page template (creates very simple HTML webpage, suitable to be sent through Outlook as HTML email to internal audience). Looking to track outbound links from the email to pages on intranet, and want to tag all links on the email (page template) to the intranet with a parameter in the URL string containing the content Id of the email page content item. This can then be picked up by the analytics and tracked what people are viewing.
Struggling to work out how to auto add the content ID variable onto the URL’s. have created a location scheme for our email page template, and thought I could use that to manipulate the links. I can get the link generation to add (for example) “?test=statictext” and this gets appended to links regardless of whether the link is in body of the email content item or within a snippet added to the page in related content. However can’t replace the ‘statictext’ example above, with the content ID of the email page itself. Is location scheme the right place to do this? Could it be done in the page template itself somehow?
Hopefully I’ve explained myself. Ultimately if we are sending out 10 emails a week, we want to be able to track the links people are clicking from each email to each page they visit!
Any ideas?
Hi Kris,
Can you please copy and paste the section from your page template that includes the links? And/or include a copy of the code form the location scheme that you are working on. We should be able to better assist from there.
Regards,
CW
Hi,
Heres my location scheme so far (with the content type being our email template), and the template being the page template for the content type:
$folderprefix=$sys.site.url.replaceFirst("^.*//[^/]*/","/");if($folderprefix=="/") $folderprefix="";$newcolour=‘kristest2’;
if($newcolour==’’ && $sys.item.hasProperty(‘rx:colour’))
$newcolour=$sys.item.getProperty(‘rx:colour’).String;
$sitepath=$sys.pub_path.toLowerCase().replaceAll(’[^a-z0-9_-/:]’,’’).replace(’/homepage/’,’/’).replace(’/home/’,’/’);
$setfilename=’’;
if($user.psoRelationships.isLandingPage($sys.item.getProperty(‘rx:sys_contentid’).String)) $setfilename=‘index.html#test=2’;
if($setfilename==’’ && $sys.item.hasProperty(‘rx:filename’)) $setfilename=$sys.item.getProperty(‘rx:filename’).String + ‘#test=’ + $newcolour;
if($setfilename==’’) $setfilename = $sys.item.getProperty(‘rx:sys_title’).String.toLowerCase().replaceAll(’[^a-z0-9_-/:]’,’’) + $rx.cond.choose($sys.template.suffix!="",$sys.template.suffix,$rx.location.getFirstDefined($sys.item,‘rx:img1_ext,rx:sys_suffix’, ‘.html#test=2’));
$rx.cond.choose($sys.crossSiteLink, $sys.site.url, $folderprefix)+$sitepath+$sys.template.prefix+$setfilename+$sys.template.suffix
line 2 contains my test variable, which is called (so far) in one place (line 11)
The page templates don;t have any specific code for the links - they rely on on inline links, or inline template snippets, so not sure what you would want to see here?
Hi Kris,
Are the links defined in a snippet template? You can send me that code if they are. Also, can you tell me what you are using as a delivery context and an assembly context? You can view this by:
Publishing Design --> Select your site’s editions that you are using for this content --> Select a content list you are using --> Action -> edit selected content list association.
Select the content list you are using to publish this content.
Regards,
CW
For the purposes of my test so far, I had created a new edition, based on our existing incremental publish for the site. it contains one content list, also set up for this test, based on our non binary incremental publish. The only difference is the delivery context uses the new context created for this test (based on existing) which uses the location scheme pasted above.
Our content list uses following query:
select rx:sys_contentid, rx:sys_folderid from rx:lgrbIntranetEmail where jcr:path like ‘//Sites/lgrbIntranet/_email%’
I have not set up the assembly context yet, and just manually changed the preview URL to show the contect ID of the new delivery context.
links are defined in the sys_inline_link slot and sys_inline_variant for example, but I think we have the option of inserting feature box and action box snippets into the Intranetemail page template. Those snippets could also use the sys_inline_link slot or sys_inline_variant slot. So as far as I can tell, we do not have a specific template I can send code for…
Hi, Andrew Allan has helped us to find a solution. Thanks for your time. (answer was in the page templates after all, not in the location schemes)
regards,
Kris