How does the <img> tag get inserted for tracking opens?

corey34

Active Member
I have created some extensions for some custom work and I am trying to figuring out what is going on. How does the <img> tag that tracks opens, get inserted into emails? And where is the file?

It seems to interact with my extension in a weird way.

Thanks
 
@corey34 - The tracking pixel is inserted by "CampaignHelper::parseContent" ( /apps/common/components/helpers/CampaignHelper.php )and it is looking for the closing </body> tag and adds the img tag right before it.
 
@corey34 - The tracking pixel is inserted by "CampaignHelper::parseContent" ( /apps/common/components/helpers/CampaignHelper.php )and it is looking for the closing </body> tag and adds the img tag right before it.
if ($appendBeacon && !empty($subscriber->subscriber_id) && !self::contentHasOpenTrackingBeacon($content, $campaign, $subscriber)) {
$beaconImage = self::getOpenTrackingBeacon($campaign, $subscriber);
$content = str_ireplace('</body>', $beaconImage . "\n" . '</body>', $content);
Where i can add in last line , like if i want to add pixel https://mydomain/impression/something-to-track-to-open/ ?
 
You'll have to add your pixel in the email template itself, we don't allow hooks in this area as they might break tracking.
 
Back
Top