MailGun API Tracking set to false

Discussion in 'General discussions' started by ART-Marketer, Dec 7, 2018.

  1. ART-Marketer

    ART-Marketer New Member

    Joined:
    Apr 22, 2016
    Messages:
    26
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    The MailGun API Delivery Servers in MailWizz seem to be hardcoded with the following information in the header:
    X-Mailgun-Track: false
    Is there a way to enable MailGun tracking from within the MailWizz application?
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,354
    Likes Received:
    2,406
    It's like that for a reason, because mailwizz does the tracking, not mailgun.
     
  3. ART-Marketer

    ART-Marketer New Member

    Joined:
    Apr 22, 2016
    Messages:
    26
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    I'm aware that MailWizz offers tracking, however it does not provide roll up reporting for a client across several campaigns in a given time frame.
    Is there a way to enable MailGun tracking from within the MailWizz application without modifying the code?
     
  4. ART-Marketer

    ART-Marketer New Member

    Joined:
    Apr 22, 2016
    Messages:
    26
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    MailWizz also does not insert the system tracking URL if a url is inserted as variable data. In order for that to function, the url has to be rewritten after it is passed to the MailGun or another provider.
     
  5. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,354
    Likes Received:
    2,406
    You're pretty much on your own, you can edit the file /apps/common/models/DeliveryServerMailgunWebApi.php and look after:
    PHP:
    $message = array(
        
    'from'       => sprintf('=?%s?B?%s?= <%s>'strtolower(Yii::app()->charset), base64_encode($fromName), $fromEmail),
        
    'to'         => sprintf('=?%s?B?%s?= <%s>'strtolower(Yii::app()->charset), base64_encode($toName), $toEmail),
        
    'subject'    => $params['subject'],
        
    'text'       => !empty($params['plainText']) ? $params['plainText'] : CampaignHelper::htmlToText($params['body']),
        
    'html'       => $params['body'],
        
    'o:tracking' => false,
        
    'o:tag'      => array('bulk-mail'),
        
    'v:metadata' => CJSON::encode($metaData),
    );
    And set the o:tracking key to true:
    PHP:
    $message = array(
        
    'from'       => sprintf('=?%s?B?%s?= <%s>'strtolower(Yii::app()->charset), base64_encode($fromName), $fromEmail),
        
    'to'         => sprintf('=?%s?B?%s?= <%s>'strtolower(Yii::app()->charset), base64_encode($toName), $toEmail),
        
    'subject'    => $params['subject'],
        
    'text'       => !empty($params['plainText']) ? $params['plainText'] : CampaignHelper::htmlToText($params['body']),
        
    'html'       => $params['body'],
        
    'o:tracking' => true,
        
    'o:tag'      => array('bulk-mail'),
        
    'v:metadata' => CJSON::encode($metaData),
    );
     
  6. ART-Marketer

    ART-Marketer New Member

    Joined:
    Apr 22, 2016
    Messages:
    26
    Likes Received:
    1
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    2
    Thank you.
     
  7. Michael Wilding

    Michael Wilding Active Member

    Joined:
    Apr 28, 2015
    Messages:
    262
    Likes Received:
    28
    S.E:
    2020-04-07 15:49:27
    L.T:
    Regular
    L.C:
    1
    Did you get this working? I've set the o:tracking to true but still not showing opens and clicks inside MailGun?

    TBH I don't really want to use MailGun tracking, but I would really like to have delivery and engagement broken down by mailbox providers, and if possible show number of emails (and percentage of list) sent to each provider. Would be incredibly helpful.
     

Share This Page