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.
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.
I received a custom tag by a marketing firm to place on a Wordpress site for tracking clicks on certain buttons. I am using the Elementor page builder on the site and have given each button a unique button ID. I am new to Google Tag manager by the way. From my understanding, I would need to use the custom html tag option so that I can use the marketing firm's custom tag with their tracking code. When creating the custom html tag in GTM, I'm presented with html box and am stuck as to how to get the tracking code to fire. I've set up the trigger to correspond with the button ID but that isn't enough. Here's what I've tried:
I've tried just entering (see below) in the HTML field: (the example is for the newsletter button). I thought maybe there is some "magic" that tag manager uses to build the event listener but I couldn't get anything to fire.
'''<noscript><img src="https://tags.srv............." width="1" height="1"/></noscript>'''
Next I tried to inject something like this to no avail (see my note as I was guessing here):
<script>
document.addEventListener("DOMContentLoaded", function(event) {
jQuery('#newsletter_send_button a').click(function(){
//tracking code here
//for example Facebook Pixel:
fbq('trackCustom','newsletter_send_button'); <<<HERE IS WHERE I'M UNSURE
OF WHAT TO PUT IN.>>>
</scipt>
<noscript>
<img src="https://tags.srv...................."
width="1"
height="1"/>
</noscript>
Google tag manager is installed on the site. I see my universal tag firing so I know I'm good. Now how do I add this custom tracker to individual buttons on the site? Maybe I'm headed in the wrong direction but I think I have to use the Custom HTML option in Google Tag Manager because the tracker info is being sent to the marketing agency and not the business's individual GTM account. I'm just at a loss. I "think" the tracker is a Facebook pixel because of the tag (just guessing here). Any ideas?
In case anyone else runs across this thread, I as able to get it to work. If a 3rd party agency (marketing) sends you a img pixel, use the Custom Image tag in Google Tag Manager and input only the URL (no img tag or height/width) in the Image URL area and leave Cachebusting on. Sounds simple after you figure. Also, if you are using Elementor forms and are looking to fire the tag based on a successful form submission, one word of recommendation is to create a separate redirect page and set the trigger to be the page url of the redirect page. You can use the div.elementor-message-success css tag as the element trigger but that works for all successful form submissions and getting GTM to read the form ID after the submit button has been clicked didn't work for me hence why I just used the redirect url as the trigger.
I'm new to GTM, coming from GA.
In GA, if I wanted to track clicks to a given element, I would place that code in an onclick event.
How would one accomplish this with a GTM tag?
Suppose I have:
<div id="click_me" >
** hot new content **
</div>
I would like to create a tag to track every time this element is clicked.
I have already set up the GTM container on my site, along with GA, and connected the two with a "Universal Analytics" tag, all of which seems to be correctly configured like so..
Where do I go from here?
You should refer to this resource on how to create an event tag to track your clicks: https://support.google.com/analytics/answer/6164470?hl=en
Your trigger would be based on the ID that is clicked and could look something like this:
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.
I have a project page at http://fulldecent.github.io/cameralife/ and some users will "convert" by selecting this text on the page:
git clone https://github.com/fulldecent/cameralife.git
And hopefully they will paste this into a terminal :-)
I am looking for advice on how to fire a Google Analytics goal when this text is selected. Right now I am working with:
Attach to mouseup
Check createRange or window.getSelection
Fire Analytics goal
That technique is at: Selected text event trigger in Javascript
This approach is from 2010, and wanted to ask first. Is this the best approach with HTML5 or should I be using a more modern approach?
I would suggest looking at CopyPaste by Tynt. The main purpose is different (inserting your URL to copied text), but why wouldn't it allow firing an trackEvent request, which would subsequently record a conversion (assuming you would set up goal tracking based on specific event occurrence)