Hi everyone,
I’m trying to track the clicks made on a Landing Page, but I haven’t been able to make it work.
I’ve tried it in two ways:
- Tracking it using Adobe’s native method.
I tried it without adding anything to the HTML of my Landing Page, but it didn’t work.
Then I tried adding part of the code to the CTA I want to track, and another part at the end of the HTML, inside the body.
//Inside CTA
onclick="sendTagClick('clickcontratar_cta'); return true;"
//At the bottom, inside body.
<script>
function sendTagClick(tagName) {
try {
if (document.controller && typeof document.controller.submitTag === "function") {
document.controller.submitTag(tagName);
console.log("Tag enviada:", tagName);
}
} catch (e) {
console.error("Error al enviar tracking tag:", e);
}
}
</script>
- The other method I’ve tried is manually inserting a pixel into the Landing Page, but it hasn’t worked either.
What I did in this case was insert this piece of code into the CTA and another one at the beginning of the head.
//At the top, inside the HEAD
<script>
var adcV7 = {}
adcV7.sendTracking= function(identifier)
{
// https://mywebsite.campaign.adobe.com/r/?tagid=clickCRSSimulador&rcpid=iRecipientId%3D33644046&jobid=138176
simulador_buton();
document.controller.setValue("/ctx/vars/clickContratar", "true");
var urlEntorno = "https://mywebsite.campaign.adobe.com";// document.controller.getValue("/ctx/vars/urlEntorno").toString();
var idRecipient = document.controller.getValue("/ctx/recipient/@id").toString() ;
var idDeliveryHex = document.controller.getValue("/ctx/vars/idHex").toString() ;
var imgtrack = "<img width='0' height='0' src='" + urlEntorno+ "/r/" + Math.random().toString() + "?tagid=" + identifier + "&rcpid=" + idRecipient + "&jobid=" + idDeliveryHex + "'/>";
$("#bodyId").after(imgtrack);
}
</script>
//Tag on CTA
<div class="aligncen" style="padding-top:50px">
<a target="_blank" class="btn botoncabecera color004d40" href="https://website.com/CA-FRONT/NBE/web/particulares/?redirect=21a0bbed-e2da-471d-b8ad-945cb0b36ba1&utm_source=lanzamiento&utm_medium=landingpage" onclick="adcV7.sendTracking('clickContratar'); return true;">
CTA
</a>
</div>
Ultimately, what I’m trying to achieve is the ability to track the clicks on my Landing Page and have that data appear in Adobe Campaign.
The query I’m using to retrieve the click data is based on the targeting dimension nms:recipient and the filtering dimension nms:trackingLogRcp.
Thank you in advance.
Diego