I have a question, I want to add a new category in event tracking data in GA, I added the script ga.js, And in my js when I press on the button I do :
GA._trackEvent('Game','Play',value);
I looked in console network of browser, so the script have the state 200 OK,
the properties of this script :
utmac UA-1xxxx-1
utmcs UTF-8
utmdt Games
utme 5(Game*Play*Golf)
..............
The problem is that the category is not added in the google analytics. I look in the Audience>Cutom>Custom Variables. Can you help me please? What I'm doing wrong? Thx in advance
I think you are mixing a few things up here.
You have added code for event tracking
You are talking about checking custom variables (Audience>Cutom>Custom Variables)
You talk about categories.
Lets take them one at a time.
Event tracking:
Event Tracking is when a user clicks on a button this is an event you can track the button click in Google Analytics by adding the event tracking tag to the button click
<a onclick="_trackevent('button', 'click', 'linktohome');" href="http://www.home.com">home</a>
Google Analytics then should store a hit under behavior -> events -> overview
Custom varables
Custom variables are name-value pair tags that you can insert in your tracking code in order to refine Google Analytics tracking.
If I have a blog site and I have different authors on my blog site, I might create a custom variable for the author name so that I could track in Google Analytics who the author was for a blog post.
Custom variables must be set up in the Admin section of the Google Analytics website each variable has an index id.
_setCustomVar("1", "Author", "Jane Doe");
This tag is added at the top of the page along side your normal Google analytics snippet.
Custom variables can be seen (Audience>Cutom>Custom Variables)
Catagorie
Now Categories associated with the event can be seen at
behavior -> events -> overview
Update:
The signature of the _trackEvent() method is as follows:
_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)
category (required) The name you supply for the group of objects you want to track.
action (required) A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.
opt_label (optional) An optional string to provide additional dimensions to the event data.
opt_value (optional) An integer that you can use to provide numerical data about the user event.
opt_noninteraction (optional) A boolean that when set to true, indicates that the event hit will not be used in bounce-rate calculation.
Related
Yesterday I got 200+ link clicks on the affiliate dashboard, it only shows around 30 clicks on analytics. I did the setup via tag manager for link click tracking and want to track affiliate link clicks as goals in analytics correctly.
The affiliate platform shows a lot more clicks and analytics is tracking only a few. I have three affiliate links in every post on the blog that I want to be tracked when someone clicks on them.
For e.g: https://www.spiritual-galaxy.com/angel-number-192/ , there are 3 affiliate links here, attaching the screenshots.
Screenshot - Affiliate Link 1
Screenshot - Affiliate Link 2
Screenshot - Affiliate Link 3
Attaching the screenshot for GTM settings.
Screenshot GTM
Attaching the screenshot for tracking event (affiliate link click) as a goal on analytics.
Screenshot - Track Event
GTMs click events can be challenging, and you get no data until it hits GA.
I would use the outbound clicks listener and manage rules inside of ListenLayer for what defines an affiliate link. It will then give you reporting on your click events directly so you will be able to see that compared to GTM.
Step 1: Create an account, get your script and place it on your website via GTM. Then turn on the Outbound Clicks Listener and it's Activity Features on the feature screen.
Step 2: Publish your changes and preview your website in GTM. Click on your affiliate links and you will see an outboundClick event pushed into the data layer for each click. . You can see here there are a ton of pieces of info that are really useful. Each row is a unique element of that click event and you can use them to customize your affiliate click data layer activity for better tracking.
Step 3: Let's identify your affiliate links via ListenLayer with some rules. The issue is that the Listener is going to capture all Outbound Clicks, and I'm assuming you might have some that are NOT affiliate links. You can also use the following process to categorize your affiliate links with a lookup table so you can actually segment which ones are receiving clicks!
Turn on the Custom Data Layer Feature under the Outbound Clicks Features screen. Then create a new data layer variable under Global Custom Data Layer Variables I'm creating one called affiliateClick. I am going to write some rules to push "yes" into this variable in my data layer whenever an affiliate link is clicked!
Step 3: Inside my Outbound Clicks Listener navigation, I will select Custom Values. Then create a Lookup Rule. We're going to use some values in our automatic data layer to determine if a click is an affiliate click. You can see in step 3 I would recommend just using a variable and selecting from this list.
For example, maybe you use hostname because you know all the website domains you will link to that are affiliate. Or you could add a URL parameter to all affiliate links and target that in the click event. I'm going to select Hostname. On the next step, select to define a value for the variable we created in step 2. Then click save and manage values.
Step 4: A table will be generate and you can insert rows. Each row is a rule, read top to bottom and it stops when a match is found. Here are my rules, your affiliate domain is at the top and I have some fake examples of others. You can see how you could also name or categorize these with this rule. At the bottom I have a catch all "no".
Save and publish your changes.
Step 5: Now your outbound clicks that are affiliate links will have this clear "Yes" value in the data layer
So instead of trying to use GTM to target some crazy xpath value, you can simply target event = outboundClick and clickCustomValues.affiliateClick= yes for a trigger that will universally capture your affiliate links. Now, if you wanted to you could get super fancy and categorize your affiliate links and pass them into GTM with a variable and pass that to GA with every event - all dynamically.
I'm sortof assuming you know GTM pretty well but basically you just need to be able to create Custom Event triggers based on the event name in the data layer outboundClick and capture data layer variables. If you need help with just reading and using data layer activity in GTM, there are probably a ton of details in other answers on stackoverflow.
Here is a problem I am facing. I want to build a podcast recommendation engine and wanted some behavior click information. Here is the app https://podflix.app
What is the source page or the podcast ID
And which podcast or recommendation people clicked for a given source podcast.
Also what tracking library to use for custom json tracking? I am currently using google analytics but can't send custom json in events data.
Is there a way to get this information tracked automatically?
I recommend you use Google Tag Manager for this. Look into auto event variables in GTM.
Then look at click triggers and event tracking in GTM. Tie these together you should be able to form a solution. Give it a try and let me know if you run into issues.
Example,
For podcast id you would create a link click trigger and register the GA event to track the "href" of the link in the event label.
i have a customer who is using Jimdo, he wants to sell his products via affiliate networks and he wants to share a 30% Commission based on the sales amount.
The affiliate network provided this pixel:
<iframe src="https://network.com/track?offer_id=123&amount={sale_amount}" height="1" width="1" frameborder="0" scrolling="no"></iframe>
I need to figure out how to pass the final conversion value from Jimdo back to the network.
Jimdo Problems:
Due to the HomePage kit, no individual thank you pages pages can be created. There is only one Page /orderconfirmation to add the pixel.
That's why I've been looking for a new solution and are currently trying to solve affiliate plans of my customer with the Google Tag Manager (GTM).
Now I we have new problems.
Typically, with Google Tag Manager you can detect different DataLayers that allow you to work with them. Unfortunately, Jimdo is not really transparent and GTM is not able to capture this DataLayer.
If you check their website structure with your browser, the are actually have all data points.
Module ID
List item
Data-product-id
Data-variant-id
Data-product-count
Data-product-item-id
Data-product-hash
Order_tracking_ID
If this cant be done, fine.
Then I just try to determine the code structure of the cart value.
picture
I need to know how to get sales amount value and pass it back to the affiliate network via Google Tag Manager.
Trigger should be the last button "buy now" before the thank you and on the thank you page the pixel should fire www.somejimdosite.com/orderconfirmation
Other ideas are welcome!
What javascript query could help to solve this problem? (Tag in GTM)
Can this help to get the data?
document.querySelector(".cc-checkout-number span").textContent
You don't even need custom javascript - the DOM type variables can be used to retrieve the text content of a CSS selector (will match the first one it finds, but I assume checkout number will occur only once on the page). You just need to set selection method to "CSS Selector" instead the default "Id". If you do not enter anything in "Attribute name" the variable will return the textContent.
And take care that you do not fire your tag on page load - the DOM needs to be there to be scraped, so DOM ready is the earliest moment you can use this
I have a website and I'm using Google Analytics.
I have widgets for popular posts, latest posts, posts list, etc...
I want to know if the user clicked on the link in the popular posts widget or the latest posts widget, for example, before getting to that post page.
I can change the link to something like:
example.com/post?ref=popular
example.com/post?ref=latest
example.com/post?ref=search
But I don't want those to be treated as different pages.
How can I do that?
Given that you are looking to simply count the number of times someone clicks on the links, then you want to use Google Analytics Event Tracking: http://davidshawblog.com/2013/01/18/google-analytics-event-tracking/
You need to add an onclick event to your links and provide a name for them, e.g.:
onClick="_gaq.push(['_trackEvent', 'Popular Posts', 'Clicked', 'Post Name']);"
Hope that helps
On my site I have a form that spans 2 steps each step 1 posts back to the same page and loads the second part of the form. The only difference between step 1 and step 2 in terms of URL is an anchor text in the url
e.g.
STEP 1 : www.mysite.com/enquiry/
STEP 2 : www.mysite.com/enquiry/#message
is it possible to track these in goal funnnels? If not would i have to hardcode some tracking paramater into the GA code?
_setAllowAnchor(bool) won't solve your problem; that's a function for allowing Google Analytics to read campaign query strings from the anchor (ie, #utm_medium=cpc.)
This can be hard to do reliably cross-browser without something like jQuery.
You'll need to include a plugin like this to deal with past IE problems: http://benalman.com/code/projects/jquery-hashchange/docs/files/jquery-ba-hashchange-js.html
The following should attach a function to a cross-browser compatible hashchange event, and then create a 'fake' pageview to allow you to track it separately in Google Analytics.
$(window).hashchange( function() {
_gaq.push(['_trackPageview',location.pathname+location.search+location.hash]);
});
});
This should have wider compatibility than some of the other options.
In GA, in your stated example, the 'anchored' page will track as /enquiry/#message.