Better Event tracking with Google Analytics

  • 2 January 2015
  • 4 replies
  • 4 views

Hi,
I have succesfully used the description here to track events: http://support.unbounce.com/entries/2…
The thing is that it only tracks forms and buttons and usually in landingpage optimization you combine buttons and links for better conversion.
I have two asks/suggestions for better event tracking:

  1. Is it possible to add event tracking of click on external links in the script?
  2. Much better and more logical solution: Can you make an alternative script that only sets event tracking on whatever conversion goal you have activated (forms, buttons or links) so that event tracking in google is consistent with what you consider as a conversion goal?
    I hope one of these is possible and of course mostly the second.
    Thanks for really good service anyhow!!
    Best regards
    Lars

4 replies

Hi Lars, 

It looks like you’ve already connected with Laura, so I’m going to share with the community the answer she gave you. 

The best way to track your external links would be to add the code manually using the following script: ``` <a href=“http://outgoinglink.com"
onclick=“ga(‘send’,‘event’,‘Outgoing Links’,‘outgoinglink.com’)” target=”_blank">Link Text</a>

  
 We created the button tracking script because Unbounce doesn't let you alter the code for an individual button at all, so adding Google Analytics via the normal process isn't possible.

Hi Lars, 

It looks like you’ve already connected with Laura, so I’m going to share with the community the answer she gave you. 

The best way to track your external links would be to add the code manually using the following script:

```
onclick="ga('send','event','Outgoing Links','outgoinglink.com')" target="_blank">Link Text</a>
```
At the moment there is no automatic script that you can add to Script Manager that will automatically track all external links or Conversion Goals as Events in Google Analytics. And while it is definitely possible, creating a similar script for text links would be pretty complicated (the button script has gone through 3-4 iterations and we test it regularly to ensure it's still working).We created the button tracking script because Unbounce doesn't let you alter the code for an individual button at all, so adding Google Analytics via the normal process isn't possible.

Hi,

I’m just following up here to close the issue for now as I have had a parallel dialogue directly with the team.

I can’t use the manual code as we have clients and nearly 100 pages to handle. So I need one single script.

But I managed to code something myself in javascript, which only tracks ticked conversion goals and differentiates between forms, buttons, imagelinks and textlinks. And during some test days we have made it work. So I’m good for now, but Unbounce should really get something similar as I believe it’s a needed, but complex request.

Latest news is that Unbounce will try to take a look at my scripts so I will send them the script directly. Maybe this will end up with a script for more people to use.

As I said, this is just info to not having this issue stand unanswered.
Best regards
Lars

Update: 
We’ve implemented a much easier way to implement Google Analytics and Event Tracking on your landing pages by using Script Manager. 

Check out the release here: 
/topics/new-feature-integrate-google-analytics-event-tracking-with-script-manager

Or check out the full step-by-step guide in our Academy here: 
http://documentation.unbounce.com/hc/en-us/articles/203509974-Integrating-with-Google-Analytics?flash_digest=a33c98b7961eed24cb5971106e1b0303a98480f7

Reply