Tracking Affiliate Advertising Clicks in Google Analytics

KB ID 0000632

Problem

Google Analytics is great at telling you what’s coming into your site, but it’s not designed to tell you what’s going out. For the most part that’s OK, but what if you have affiliate adverts, and you want to track if your visitors are clicking on them, or you want to find out which ones are NOT getting clicked on so you can drop them.

Solution

1. First you need to delay the result of the ‘click’ by a tiny amount, your visitor will not notice but it gives time for the javascript tracking code to load, before the visitor has clicked and is off on their merry way. On the page in question locate your Analytics tracking code.

Note: This is just for the new ‘asynchronous’ version of the code, for the old version see this post.

2. Paste in the code AFTER your Analytics code. Change the Analytics tracking code account number (shown below as UA-123456-1), to your own!

[box]

<script type="text/javascript">
function recordOutboundLink(link, category, action) {
  try {
    var pageTracker=_gat._getTracker("UA-123456-1");
    pageTracker._trackEvent(category, action);
    setTimeout('document.location = "' + link.href + '"', 100)
  }catch(err){}
}
</script>

[/box]

Like so;

3. Then add the following to your advert/link.

[box]

<a rel="nofollow" href="http://www.affiliate.com" onclick="recordOutboundLink(this, 'Affiliate Ad', 'Advert1');return false;"></a>

[/box]

Like so;

4. Log into Google Analytics > Content > Events > Overview.

Related Articles, References, Credits, or External Links

Can’t see Google Ads!

Exchange – Setup previously failed while performing the action ‘Uninstall’

KB ID 0000877

Problem

After I managed to break my test Exchange 2013 Server the other week, I built a new one and migrated all the data into it. But while trying to decommission the old Exchange box, the process failed and I was stuck with this error.

Setup previously failed while performing the action "Uninstall".
You can't resume setup by performing the action "Install".

So now I couldn’t uninstall, or attempt to ‘repair install’ in an effort to remove Exchange.

Solution

This happens because when you attempted to uninstall, the process adds some registry key(s) and sets them to the uninstall state, you need to locate and delete them before you can proceed.

1. Windows Key+R > Regedit {Enter} > Navigate to;

[box]
HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > ExchangeServer > (version)[/box]

Here you will need to check the sub-keys, for the roles that were installed on this machine, below you can see the ClientAccessRole sub-key has a value called Action, that has been set to Uninstall, that needs to be deleted.

2. Here you can see the mailbox role is clear and requires no action.

Note: This is an Exchange 2013 Server, so it can only be a Mailbox or a Client Access Role Server. With earlier versions of Exchange you may also want to check HubTransportRole.

3. Once the values have been removed you should be able to proceed.

 

Related Articles, References, Credits, or External Links

Exchange: “BuildToBuildUpgrade” Error

Packet-Tracer Fails Subtype: rpf-check Result: DROP

KB ID 000904 

Problem

I love packet-tracer, I use it a lot, especially when I’ve been told that the firewall I’ve installed is stopping a particular port. I had set up a simple port forward the other day, and when I went to check it with packet-tracer this happened.

[box]

Petes-ASA# packet-tracer input outside tcp 123.123.123.123 443 192.168.1.10 443

<——-Output removed——–>

Phase: 7
Type: NAT
Subtype: rpf-check
Result: DROP

Config:
object network Web-Server-INT
nat (inside,outside) static Web-Server-EXT
Additional Information:

<——-Output removed——–>

[/box]

Solution

This happens because the packet-tracer command is expecting to see the address that exists on the outside interface. So it’s the opposite way round to the way you would write an ACL. (Unless you are an old school Cisco tech, then it’s the same way we used to write ACL’s (before version 8.3)).

So, as I’m port forwarding the port that I’m tracing (tcp port 443 or https if you prefer) from the outside interface (100.100.100.100), that’s the IP address I should be using.

Note: If you are testing a static translation, then you would use the public IP for testing inbound traffic.

[box]

Petes-ASA# packet-tracer input outside tcp 123.123.123.123 443 100.100.100.100 443

Phase: 1
Type: UN-NAT
Subtype: static
Result: ALLOW
Config:
object network Web-Server-INT
nat (inside,outside) static Web-Server-EXT
Additional Information:
NAT divert to egress interface inside
Untranslate Web-Server-EXT/443 to Web-Server-INT/443

Phase: 2
Type: ACCESS-LIST
Subtype: log
Result: ALLOW
Config:
access-group inbound in interface outside
access-list inbound extended permit tcp any4 object Web-Server-INT eq https
Additional Information:

Phase: 3
Type: NAT
Subtype: per-session
Result: ALLOW
Config:
Additional Information:

Phase: 4
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:

Phase: 5
Type:
Subtype:
Result: ALLOW
Config:
Additional Information:

Phase: 6
Type: VPN
Subtype: ipsec-tunnel-flow
Result: ALLOW
Config:
Additional Information:

Phase: 7
Type: NAT
Subtype: rpf-check
Result: ALLOW

Config:
object network Web-Server-INT
nat (inside,outside) static Web-Server-EXT
Additional Information:

Phase: 8
Type: NAT
Subtype: per-session
Result: ALLOW
Config:
Additional Information:

Phase: 9
Type: IP-OPTIONS
Subtype:
Result: ALLOW
Config:
Additional Information:

Phase: 10
Type: FLOW-CREATION
Subtype:
Result: ALLOW
Config:
Additional Information:
New flow created with id 5844584, packet dispatched to next module

Result:
input-interface: outside
input-status: up
input-line-status: up
output-interface: inside
output-status: up
output-line-status: up
Action: allow

[/box]

Do the same from the ADSM

As you can see below, the same thing happens if you use the graphical Packet Tracer in the ASDM

Related Articles, References, Credits, or External Links

NA