On your WisePops dashboard, we display the total number of clicks on the links and calls-to-action with tracking activated.

In some situations, you might want to track the number of clicks on each link.

To do so, we're going to use our JS callback feature.

Step 1:
Open your popup in the editor.

Step 2:
In the left menu click on "JS":


Step 3:
Click on "Add new script"


Step 4:

Select "After tracked click" and copy/paste the following script:

ga(function () {

var trackingIds = [];
ga.getAll().forEach(function (tracker) {
if (trackingIds.indexOf(tracker.get('trackingId')) === -1) {
trackingIds.push(tracker.get('trackingId'));
ga(
tracker.get('name') + '.' + 'send',
'event',
'WisePops',
'Click CTA',
event.target.textContent
);
}
});
});

On the script is live, it will trigger Google Analytics with the following properties:
• Event category: WisePops
• Event action: Click CTA
• Event label: the text of your CTA or link

Did this answer your question?