Overview
In order to view message performance based on your contact's email domain, we created Smarty code to paste into your messages that will create stats filters for all major domains. Any localized domains (.co, .uk, .de, .fr, etc.) will be rolled up to the primary domain (gmail.com, yahoo.com, etc.) and stats will be viewed as an aggregate.
Example
In the example below, you can click on the tabs to view the HTML content include code, the message code, and the filtered stats results.
-
{*. Place this include in an HTML include and name it domain_stats. *} {$domain_stats.debug = 0} {$domain_stats.logs.yahoo_domains = ['aol.com', 'yahoo.com', 'yahoo.co.uk', 'yahoo.com.tw', 'yahoo.de', 'yahoo.fr', 'yahoo.co.jp', 'yahoo.com.br', 'yahoo.ca', 'yahoo.es', 'yahoo.com.au', 'yahoo.com.hk', 'yahoo.it', 'yahoo.gr', 'ymail.com']} {$domain_stats.logs.hotmail_domains = ['hotmail.com', 'hotmail.co', 'hotmail.it', 'hotmail.fr', 'hotmail.es', 'hotmail.de', 'outlook.com', 'microsoft.com', 'microsoft.co', 'msft.com', 'live.com', 'live.co.uk', 'live.co', 'live.eu','live.com.au', 'hotmail.co.uk', 'hotmail.ca', 'onedrive.com', 'outlook.com', 'outlook.co', 'outlook.eu', 'outlook.co.uk', 'outlook.fr', 'live.de', 'microsoft.fr', 'live.fr', 'live.ca', 'live.nl', 'live.se', 'live.dk','microsoft.de', 'outlook.de', 'msn.com']} {$domain_stats.logs.gmail_domains = ['gmail.com', 'googlemail.com']} {$domain_stats.logs.apple_domains = ['me.com', 'icloud.com', 'mac.com']} {$domain_stats.logs.att_domains = ['att.net', 'sbcglobal.net', 'bellsouth.net']} {$domain_stats.logs.orange_domains = ['orange.fr', 'wanadoo.fr']} {$domain_stats.email_parts = "@"|explode:$contact.channels.email.address} {$domain_stats.domain = $domain_stats.email_parts[1]} {if $domain_stats.debug == 1} domain to check: {$domain_stats.domain} {/if} {foreach from=$domain_stats.logs key=isp item=domains} {if in_array($domain_stats.domain, $domains)} {if $domain_stats.debug == 1} matched: {$domain_stats.domain} will add stat filter called {$isp} {else} {$utils->addSendTag({$isp})} {break} {/if} {/if} {/foreach} {if $domain_stats.debug == 1} <h1>Domain Stats Data</h1> <pre> {$JSON_PRETTY_PRINT = 128} {json_encode($domain_stats, $JSON_PRETTY_PRINT)} </pre> <br><hr><br> {/if}
-
{include 'content:domain_stats' scope='parent' assign='blackhole'}
<!-- Message HTML -->
HTML content include code
To keep your message HTML clean, paste the necessary code into an HTML content snippet and then include that code in the message.
Navigate to Content > HTML Content, create a new content piece, title it "domain_stats," and paste the following code:
{*. Place this include in an HTML include and name it domain_stats. *} {$domain_stats.debug = 0} {$domain_stats.logs.yahoo_domains = ['aol.com', 'yahoo.com', 'yahoo.co.uk', 'yahoo.com.tw', 'yahoo.de', 'yahoo.fr', 'yahoo.co.jp', 'yahoo.com.br', 'yahoo.ca', 'yahoo.es', 'yahoo.com.au', 'yahoo.com.hk', 'yahoo.it', 'yahoo.gr', 'ymail.com']} {$domain_stats.logs.hotmail_domains = ['hotmail.com', 'hotmail.co', 'hotmail.it', 'hotmail.fr', 'hotmail.es', 'hotmail.de', 'outlook.com', 'microsoft.com', 'microsoft.co', 'msft.com', 'live.com', 'live.co.uk', 'live.co', 'live.eu','live.com.au', 'hotmail.co.uk', 'hotmail.ca', 'onedrive.com', 'outlook.com', 'outlook.co', 'outlook.eu', 'outlook.co.uk', 'outlook.fr', 'live.de', 'microsoft.fr', 'live.fr', 'live.ca', 'live.nl', 'live.se', 'live.dk','microsoft.de', 'outlook.de', 'msn.com']} {$domain_stats.logs.gmail_domains = ['gmail.com', 'googlemail.com']} {$domain_stats.logs.apple_domains = ['me.com', 'icloud.com', 'mac.com']} {$domain_stats.logs.att_domains = ['att.net', 'sbcglobal.net', 'bellsouth.net']} {$domain_stats.logs.orange_domains = ['orange.fr', 'wanadoo.fr']} {$domain_stats.email_parts = "@"|explode:$contact.channels.email.address} {$domain_stats.domain = $domain_stats.email_parts[1]} {if $domain_stats.debug == 1} domain to check: {$domain_stats.domain} {/if} {foreach from=$domain_stats.logs key=isp item=domains} {if in_array($domain_stats.domain, $domains)} {if $domain_stats.debug == 1} matched: {$domain_stats.domain} will add stat filter called {$isp} {else} {$utils->addSendTag({$isp})} {break} {/if} {/if} {/foreach} {if $domain_stats.debug == 1} <h1>Domain Stats Data</h1> <pre> {$JSON_PRETTY_PRINT = 128} {json_encode($domain_stats, $JSON_PRETTY_PRINT)} </pre> <br><hr><br> {/if}
Message code
After creating your HTML include, create a new message and paste the following code at the top of your message content. This will render the HTML content from the example above at the time of the send.
{include 'content:domain_stats' scope='parent' assign='blackhole'}
<!-- Message HTML -->
View stats filter results
1. After the message has finished sending, click the Performance button under Message Performance page and scroll down to Stats Filters.
2. Click the Filter by Tag button to add the desired domains to the stats filter table.
3. Once you've added your send tags, you can view message performance for each domain.
Comments
0 comments
Please sign in to leave a comment.