Track a single anchor link in Google Analytics - google-analytics

My client's website includes multiple product pages. On each, there is an option to "Contact Sales". This option is an anchor link that changes the screen to show the salesperson's contact information. The structure looks like this:
"http://www.example.com/products/detail/product-1.html" is the product page.
"http://www.example.com/products/detail/product-1.html#contactsales" is the anchor link that makes the sales information appear. The URL doesn't change.
I would like to track as a conversion any time someone clicks the "Contact Sales" anchor link on any product page. I have seen some solutions that will track all anchor link clicks, but I don't want to track any anchor links other than "Contact Sales", and then only as conversions. What is the easiest way to do this? Thanks!

This would be easiest if you attach your event directly to the anchor:
Contact Sales
Then you would be able to create an event goal around that.

Related

Wordpress - How to create dynamic affiliate link that includes page title

What's up team,
What I'm trying to achieve in wordpress is add a dynamic affiliate link that includes the page title which leads to an external website's search page.
For example.
The post page or page is called www.website.com/blog/red-ball or www.website.com/red-ball
And I want to add a link to an affiliate's search page using the page's title. So I need the dynamic url to look like this www.affiliate.com/search?=red-ball
Now I dont have a problem doing this manually. But if I have 5 different affiliates and 1000 products, i really dont want to be going to each page and doing this one by one. What im looking for is to add a button preferably thru a shortcode that will add a button to the page for a specific affiliate with his url and the button automatically appends the page title to it.
This way I can add 5, 6, 7 or how many other affiliate partners I want and the button will lead to the partners affiliate search page automatically querying my page keywords.
Anyone have an solution or idea on how to do this?
Thank you,
Red

Google Tag Manager trigger on infinite scroll websites

I have a wordpress website that autoscrolls to next blog posts upon scrolling down infinitely and now looking for a way to count the next blog post load to register as a new pageview in google analytics which is setup in google tag manager
I stumbledupon this url http://www.howtofindit.in/how-to-call-tag-manager-code-in-infinite-scroll-website-pages/ BUT the article is poorly written and lack a proper step by step approach to follow without any confusion
Anyone know of a good step by step approach to follow to implement this?
so i can start tracking all blog page loads as pageviews in my google analytics
Just wanted to add that when the next blog post loads on the website i want to track, the page url changes to show the new blog post
so maybe that me be a good info to add here
Thanks
This article seems a bit outdated. While the suggested approach will still be working you should be able to solve this with the (relatively new) visibility trigger.
So you'd go to triggers, new, select "visibility", and as a selector you enter an element that indicates a new article - say if every blog post starts with a second level heading then you enter "h2" in the box for the selector. You need to set this to "fire every time", and "observe DOM changes" (if your posts are dynamically loaded, which they probably are).
Set up a Universal Analytics tag of the pageview type and connect it to the trigger. In "Advanced/Set Fields" you need to overwrite the "page" field (else you will get the same Url for each of your virtual pageviews). The properties of the last element that fired the visibility trigger will show up in the built-in "Click" variables (don't be bothered by the name, that's for historic reasons), so you could access the headline text in the "Click Text" variable (probably you want to format it to a more url-like format).
Save, publish, and you should be good to go.

Unique "clicked" at my Simplenews Newslwetter

I send newsletters from my drupal-7 website using Simplenews Newsletter module.
The newsletters consist of images that have links to my page. What I want, is to have a unique clicked measure. What I currently use is adding the following code:
?utm_source=newsletter_june_2016&utm_medium=email&utm_campaign=newsletter_june_2016
and then logging into Google Analytics, at Acquisition -> Campaigns -> All Campaigns and check the value of newsletter_june_2016 as an example.
But this method doesn't provide unique click for my links. If I click twice on a link, the counter gets increased by two, and Ι can't tell how many of my site's users have actually clicked the link, only how many times were the links clicked.
Is there a way to achieve that?

Google Analytics in Wordpress - Cross-Domain Tracking

I've searched high and low for an answer for this problem and need the help of experts.
The website I'm helping to oversee has a registration in a frame on their main website. When a user visits the site, they can choose which course to take and click on a "Register" link to be taken to the externally hosted form.
I was able to get the GA tags changed on the framed pages, so that step is done.
However, I realise that in order to properly cross-domain track with Google Analytics, I need to also add an onclick event to any links that bring users to those pages, such as the example below.
Link
However, the site I'm working with is in Wordpress, and when I view the link in there it looks like this:
[iab_event link="http://www.EXAMPLESITE.com/course/4105/register.asp" text="Register"]
And when you view the page source of the live site this link is translated to this:
Register
I tried adding the second onclick event to the one above, but that didn't work. Is there any way to add the onClick="pageTracker._link('http://www.EXAMPLESITE.com/course/4105/register.asp'); return false;" to this link without breaking it?
Thank you in advance for any advice given!
Try stacking them in the onclick event like this:
Register
It should run all of the commands as long as they're separated by semi-colons.

Google analytics to track impressions/views?

I have a site that lists business listings from a database. On each page you can do different things such as forward it to a friend, print the page etc. My question is could I use google analytics to track impressions and views for each listing? So if I showed the top 10 listings on the home page I want to track each listing as an impression since its being showed, then if they click one of the links to view the business listing it tracks it as a view. Then on the business listing details page if they do any of the actions such as forward to a friend or print the page I want to track that as well.
For tracking views/clicks Im assuming I would need to use setPageView passing something like setPageView('/listing/12345') correct? I dont know how to track it for impressions though. Then on the listing details page to track if they printed it etc Im assuming I would track it as an event? Such as trackEvent('listing', 'Print') if that is what I need to do for event how does it associate with the page tracking so that I could see how many times someone printed the listing page for /listings/12345?
No need to create fake page views. Google Analytics has a feature called Event Tracking, which is described in the Event Tracking Guide. The guide has an illustrative example;
A simple example illustrates how you might use the Event Tracking method
to record user interaction with a video Play link on your page. It
assumes that pageTracker is the name used for your tracking object.
Play
In this scenario, the reports for Events would display Videos as the Category,
Play as the Action, and Baby's First Birthday as the Label.
In your case, you would track Views and Clicks using the Event Tracking feature. You'd have to decide on how you'd want Actions, Categories and Labels set up to match your data. You might want package types (Gold, Silver etc) as Categories or Labels, for example.
This question and its answers are similar to your scenario.

Resources