Analytics
2.9K members online now
2.9K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Can GTM help track Ad Impressions?

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi

 

I have site running with GTM, and have set up exit clicks set up on my site so I can track how many times users have clicked on various ads and exit links.

I would like track the presence of ads so I could calculate ad click through rate and ad inventory usage (so if somebody is paying for 1M impressions, I can can see when they reach that limit).

 

The ads on my brand site could be any shape or size, and there could be multiple instances on a page. These would be identified primarily by linking out to a domain other than mybrand.com, though they could also link internally to cross promote cotent on mybrand.com.

 

Is this possible through some clever way using GTM variables and triggers?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Andy L
September 2016

Re: Can GTM help track Ad Impressions?

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
Hey Andy,

This sound like a "basic" JavaScript check wether or not one or more particular instances are in the DOM when the page loads. Counting these is a pretty straight forward approach. I would then pass these numbers to Google Analytics using one or more Custom Metric(s) or as an Event pending your need.

The tricky part is probably how to define and separate the different ads you're running if you want to keep track of them individually (or by client).

View solution in original post

Marked as Best Answer.
Solution
Accepted by topic author Andy L
September 2016

Re: Can GTM help track Ad Impressions?

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭
Hey Andy,

This sound like a "basic" JavaScript check wether or not one or more particular instances are in the DOM when the page loads. Counting these is a pretty straight forward approach. I would then pass these numbers to Google Analytics using one or more Custom Metric(s) or as an Event pending your need.

The tricky part is probably how to define and separate the different ads you're running if you want to keep track of them individually (or by client).

Re: Can GTM help track Ad Impressions?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi - thanks for the reply. I have now got this working, so thanks for the input!

With the help of a developer, I was able to set up a variable which used DOM element which used a CSS Selector which pulled in the href and "stored it".

This href would then go into a event tag when it was triggered (when my new variable matches regex http).

The fiddly thing was getting the correct CSS Selector code. My developer was greatly useful here, building up the '#block-advertisement-set-436-1076 a" code and placing "href" in the Attribute Name. I would never have guessed that code!


Variable Configuration
Variable type
DOM Element
Selection Method
CSS Selector
Element Selector
#block-advertisement-set-436-1076 a
Attribute Name
href