Skip to content

Instantly share code, notes, and snippets.

@A5hleyRich
Last active August 29, 2015 14:11
Show Gist options
  • Save A5hleyRich/235285d177892ac6d147 to your computer and use it in GitHub Desktop.
Save A5hleyRich/235285d177892ac6d147 to your computer and use it in GitHub Desktop.
Post: WordPress Outbound Link Tracking using Google Analytics
# Affiliate Links
location /out/digitalocean {
add_header X-Robots-Tag: "noindex, nofollow";
return 302 https://www.digitalocean.com/?refcode=3196717b4908;
}
location /out/studiopress {
add_header X-Robots-Tag: "noindex, nofollow";
return 302 http://www.shareasale.com/r.cfm?b=241369&u=904813&m=28169&urllink=&afftra$
}
sudo nano /etc/nginx/sites-available/ashleyrich.com
sudo nginx -s reload
<a href="/out/digitalocean/" title="DigitalOcean Affiliate Link" rel="nofollow">DigitalOcean</a>
onclick="_gaq.push(['_trackEvent', 'Outbounds', 'Click', 'DigitalOcean']);"
<a href="/out/digitalocean/" title="DigitalOcean Affiliate Link" onclick="_gaq.push(['_trackEvent', 'Outbounds', 'Click', 'DigitalOcean']);" rel="nofollow">DigitalOcean</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment