Tracking Google DFP Ad Clicks in ASP.NET - asp.net

I am wondering if it is possible to track when a user of a website clicks on a Google DFP ad. I know that the Google DFP website tracks clicks, but I want to be able to track which users (when logged in, using ASP.NET membership) are clicking ads and how many ads. Is this possible?

I've been asking a similar question and haven't found an answer yet!
The closest I've come is this - http://support.google.com/richmedia/bin/answer.py?hl=en&answer=117426
To track clicks using your own click-tracking server, you must include an attribute in the ad tags that specifies the URL for the server. The URL is accessed every time that a user clicks on an ad, enabling your server to count the click. This attribute is click=value, where value is the URL for the clicktracking server. The click-tracking URL should not contain any semicolons (;). If necessary, you can encode semicolons as the equivalent %3B characters.
The sample URL below shows an ad tag with an implemented click attribute:
http://ad.doubleclick.net/adi/N270.maheshdfasite/B3140338.2;dcopt=1_ist;click=http://site.com/cgi/clicktrack?clickid=12345&page=abcd&goto=;sz=0x0;ord=[timestamp]?
so it looks like you could put a URL to your website inside the click handler.
Is this specific to rich media (e.g. flash ads) ? I don't know!

Related

Track external search form in Google Analytics/GTM

We have a search box on our website that searches a product we subscribe to. It's hosted on the third party's server, not on our domain.
Since it's just embedded on our site, I can't use Google Analtyics' built in configuration for tracking site search.
Is there another way I can track the terms used to search in the form, using either Google Analytics/Tag Manager?
yes, you can use GTM if the search query is entered on your site. Let's say, using a trigger on the search CTA click, you can then use a custom JS variable where you get the value of the search field using JS, use that variable in a GA event tag and there you have your value logged in GA.

How To Include a cookie-id when tracking events

I am completely new to Google Tag Manager. I have gotten it installed on my site, and it is working to count the number of clicks on the register button.
However, what I really want to do is this:
A user lands on the page. I want to place a tracking cookie for the user, and then log the page view along with the tracking cookie ID.
The user then clicks the register button. I then want to track the click event along with the tracking cookie ID.
By including the tracking cookie information, I can then easily see that User A landing on the Page at 10:00, and then at 10:02 Clicked on the Register Button.
It gives a clear picture of what happened on the site. My goal is to drive people to the site through adwords, but I then need to see exactly what happened with these people and how long they were on the site.
Can I do this with GTM/Google Analytics? If so, how? If not, is there some other tool for this?
Take a look at the User Explorer report in Google Analytics.

Track foreign url using google analytics

I have a URL(https://www.mysite.com/tab/subtab/) that belongs to my website(https://www.mysite.com/). Clearly, to track clicks on this url, all I have to do is append the utm_source, utm_medium and utm_campaign parameters to it. Now, what I want to do is, track a url http://www.notmysite.com/tab/subtab/. This url is neither a part of my site, nor is it mentioned any where in my google analytics account, only the link is available for modification. If I append the utm_* params here, the "clicks" information goes to the http://www.notmysite.com website owner's GAQ account and not mine(obviously!). What parameters should be appended to this foreign url, so that I can track the clicks on it?
If this is not possible with google analytics, are there any other options?
Thanks
You will want to look into event tracking to track clicks on links.
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#Anatomy
Taking an example from Google's doc:
Click here
Any clicks on that link will now appear in Analytics under Content -> Events. Notice though how I added target="_blank" which is needed for ensure the accuracy of events for external links due to there not being enough time to send the data to Google. A workaround is to add a delay via javascript which is a better approach if you're tracking more clicks.

Google Analytics referral triggered by a bookmarklet

I have a question regarding Google Analytics and unwanted referral stats generated by a bookmarklet.
I have a web service with GA installed. My users are using a bookmarklet to accomplish a certain task while visiting some other web page. Bookmarklet creates an iframe and opens up a page which is also on my domain and that page contains the same GA code.
For some reason GA sees those web sites (pages that bookmarklet was used on) as referral pages. That creates a problem for me since those pages are not real referrals (no actual links to my site). I have no desire to track pages my users marked with the bookmarklet.
It’s important to mention that bookmarklet page must be a part of the same domain as my main page. I can not move it on other domain or subdomain.
This is what I tried so far:
I’ve created a new GA account (subdomain.mydomain.com) and used it only on my bookmarklet page hoping that all stats related with the bookmarklet will appear on that account. This worked only partially. Stats for the bookmarklet started to appear on the new account but my original GA account continued to track referral pages.
We tried to use a pop up window to load a web page instead of the iframe. No difference.
Any help on how to get rid of unwanted referral sites would be appreciated.
See _setReferrerOveride:
_setReferrerOverride()
_setReferrerOverride(newReferrerUrl)
Sets the referrer URL used to determine campaign tracking values. Use this method to allow gadgets within an iFrame to track referrals correctly. By default, campaign tracking uses the document.referrer property to determine the referrer URL, which is passed in the utmr parameter of the GIF request. However, you can over-ride this parameter with your own value. For example, if you set the new referrer to http://www.google.com/search?hl=en&q=hats, the campaign cookie stores a new campaign with source=google, medium=organic, and keyword=hats.
_gaq.push(['_setReferrerOverride', 'URL-YOU-WANT-AS-REFERRER']);
Or, you could try
_addIgnoredRef():
_addIgnoredRef()
_addIgnoredRef(newIgnoredReferrer)
Excludes a source as a referring site. Use this option when you want to set certain referring links as direct traffic, rather than as referring sites. For example, your company might own another domain that you want to track as direct traffic so that it does not show up on the "Referring Sites" reports. Requests from excluded referrals are still counted in your overall page view count.
Async Snippet (recommended)
_gaq.push(['_addIgnoredRef', 'www.sister-site.com']);
You would have to grab the referrer and populate it dynamically. Probably with parent.document.referrer Of course this might make any referrals (non-bookmarklet) from these sites not record in the future. And, at some point you would need to clear them.
The most simple solution, if you don't need to track the hits from the bookmarklet at all, is to simply not include the GA code in the web page when it is opened by the bookmarklet.
Your bookmarklet can open the page like http://yoursite.com/?mode=bookmarklet
And in your server side code you can use something like
if ( mode != "bookmarklet" ) {
outputGaCode()
}

Google Virtual Pageview Setup

I need some help with the setup of tracking virtual clicks on a submit button. What I need to do is get the referring site, which Google already tracks, and then track if they click on the button. I have setup an onclick for the submit button and setup a goal in Analytics but it is not tracking. I do have the code in place for Analytics in my header to track pageviews.
So what I am trying to do right now with my goal is to track a referring website and then track who clicks on the button. The virtual view I am using for the click is:
onclick="pageTracker._trackPageview('/Orders/Subscription');"
Thank you for any help in getting this setup working. I am still working on learning analytics.
If you want to ...get the referring site, which Google already tracks at the time the user clicks the submit button, you will have to read the cookies (the _utmz in this case) that GA sets and extract it from there.
Referral data can be obtained from the reports in GA, but if you want it at the time of submit, you'll have to get it from the cookies. Plain vanilla javascript can do this for you, just google it. Or, use whatever language your pages are written in to extract the data from the cookie (PHP and many others have this capability).
Regarding tracking the virtual page view, if the user can submit your form by hitting the enter key, then onclick is not desirable. onsubmit in the form tag would be better.
If it is still not recording for you, make sure your goal steps are entered into GA correctly (it's quite common to mess this up and GA is not forgiving to even the slightest error) and that you are using the traditional tracking snippet in the head of your document because your example is in the traditional tracking format. You should not mix async and traditional snippets.
To check if GA is even tracking your virtual page, go to the Content, Top Content report and filter by your virtual page. If it's in there, then it's your goal tracking set up. If it's not in there, it's your virtual page tracking on the form itself.
HTH.

Resources