Using GTM to add Open Graph - facebook-opengraph

Do you know, how to add open graph parameters to specific URLs on my site using Google Tag Manager? I couldn't find anywhere answer on that.
Thanks a lot!

No unfortunately not. Unlike Google where it's become a lot better in the last 3 years at using rendered JavaScript content to pick up code generated by tag managers - Facebook sadly hasn't advanced this far + will only pick up content in the actual HTML.
See this blog post (in Dutch) for guidance: http://vlcm.be/2017/07/open-graph-metatags-google-tag-manager/
So unfortunately when it comes to OGP and Twitter Cards you'll have to add them the old fashioned way.

Related

Tracking links within my site

I want to track particular links on my site to see where they come from. For example, I want to know which links on my navigation are being clicked, so if something is not being clicked I could potentially remove it.
I have been using UTM's, super easy, but results in skewed analytics data.
I looked into Google Tag Manager, but I don't want to slow down my website. I can change the site easily, so not sure if this is the best solution.
I found an article dated 2008 that says I can do this:
https://www.example.com/?from=topnav
Is that still valid? Is there a better way. I can't seem to find any information on this and assume somebody wants to acquire this information.
Thank you.
I have been using UTM's, super easy, but results in skewed analytics
data.
UTM codes are meant to track inbound traffic. Don't use them to track internal/outbound navigation, as it will seriously mess up your reporting.
I looked into Google Tag Manager, but I don't want to slow down my
website.
GTM is loading async, just like GA, so performance-wise they are equivalent.
I found an article dated 2008 that says I can do this:
https://www.example.com/?from=topnav
By default GA will not track link clicks. You can indeed add parameters to URLs and then use those to build custom reports and see which links are being clicked.
Since what you're trying to do is custom implementation, you won't find a single best answer, it's up to you to implement something that fits your needs. These are some examples:
https://analytical42.com/2017/track-internal-links-google-analytics-gtm/
https://www.gravitatedesign.com/blog/can-google-analytics-track-link-clicks/

Google Analytics, internal link analytics?

I'll use StackOverflow as an example.
A user can reach a question/answer page from
outside of stackoverflow
from another page of stackoverflow
from a search result
from a link in other posts (link in another question or answer)
from Similar Questions section
from a user profile page
I'd like to know how those internal links are used.
Main question is What are the percentages of each type of links which led users to the Q/A page in stackoverflow
I want to know the answer for the Q/A pages as a whole not for each individual Q/A page.
Is this implementable using GA and if so, I'd like to hear a general guide so I can dig in.
Is there a term for this kind of analysis? (internal link analysis? Knowning a term helps me to google further..)
Edit
I found one way to do this using sitesearch.
http://cutroni.com/blog/2010/03/30/tracking-internal-campaigns-with-google-analytics/
It's from 2010, and not sure its still the best way to do it.
To be able to tell different links from the same page e.g. you will need to setup enhanced link attribution by requiring the plugin via this command
ga('require', 'linkid', 'linkid.js');
the plugin also requires decorating each link that reffers to the same destination (the question) a unique id. you can also chose to decorate a container element such as a div which holds link or its parent (up to 5 levels)
there are a number of ways to get at this data.
One way is a under reporting look at Behavior>Behavior Flow. The view crates a sunkey diagram. which you can narrow down using a custom segment + creating a content grouping. The advantage of the Behavior flow is that it is visual - but it is difficult to customize.
Another approach you could take is to locate the question in the Behavior > Site Content>All pages and the set the secondary dimension to "Previous Page Path". You can use the advanced filter to select a specific question, and to limit the previous pages to page paths matching the pattern for each type of page you discussed.
To view the attribution for different links you need to select the In-Page Analytics tab.
FYI, I've implemented it using Google tag manager.
I defined event navigateToQnA.
And fired the event with different event action for different type of clicks I care about.
Maybe bit laborious than the sitesearch method I linked in the question.
But cleaner in a sense that you don't pollute url parameters to collect the data.

creating blogroll by inoreader, feedly or similar ones

In Google reader(R.I.P) we could select some interesting links by a special tag and then make public them and show links on our blogs or websites.
Is there a way to create this by Google reader alternatives like Inoreader or Feedly or AOL reader or etc?
I should probably start by saying that I'm the BDFL of Inoreader, but I feel obliged to answer you. If anyone thinks my answer is inappropriate or that this can be achieved with one of the other mentioned options, feel free to bash me in the comments :)
Yes, you can do that in Inoreader.
Since you are familiar with Google Reader, you shouldn't have much difficulties starting up with it, but if you have, here's a quick guide to get you started.
Depending on what you need to achieve the option you want is accessible via right-click on a folder or a tag:
Then in the dialog that pops up, you will see an Export option. Click it and you will get 3 links - for RSS feed, HTML page (what you need) and a public OPML file (for folders only):
A few notes on folders and tags:
Folders are used to group sources (RSS, social and other feeds) and content inside them is automatically populated from the feeds.
Tags on the other hand are mostly manually populated by you. When you read an article and you find it interesting, you can press "T" or click the label icon at the bottom of article to tag it. This behavior is almost identical in all major RSS readers. Working with tags in Inoreader is covered in detail in this blog post.
Now I said mostly before, because tags can also be automatically populated by Inoreader's Rules. Basically they works like your email filter. You can set up keywords or other conditions and tag articles automatically as they arrive. This feature is covered in this blog post.
Hope this helps!

Google Tag Manager: fire tag on element load

I am working on a project and the site has a lot of the same pages - they are versions of the homepage. But, depending on what page you open, it will give you a different message in a lightbox.
The whole set-up is a bit strange to me, but that's what it is....
So there are countless pages, such as "~/erejib", "~/12312", "~123niwoenf123". Due to there being no fixed length, naming convention or anything, I cannot really use a regex.
However, I could say fire on all pages that contain this lightbox ID. Does Google Tag Manager support this at all?
Thanks,
Chris
Well yes, there is nothing build into Google Tag manager for this particular problem. I ended up writing all the existing pages that I want to exclude into a giant RegEx.

Is There a way to customize the IN/Company link for LinkedIn

I have inherited some code which uses uses the LinkedIn Company Profile API. At least that's what I think it is. Basically a script tag is rendered in the following format:
<script type="IN/CompanyProfile" data-id="9999" data-format="click"></script>
This together with .js file creates a link with the Linked-in logo which when clicked on reveals profile of company. Question is, can I customize the link. I want to add some text to the right of the linked in logo. I couldn't find any relevant documentation on it. I added a span tag with some text and attempted to wire up the click of the span, so that when clicked it clicks the linkedin icon. That doesn't seem to work-- which I found rather odd.
Any thoughts?
The Company Profile plugin builder is here:
https://developer.linkedin.com/plugins/company-profile-plugin
Customization of this plugin is limited to width (using data-width) at this time because of the complex layout. However, you could build something similar using the Javascript API if you need something more customized to your system.
This is another option that is more customizable, but has less interactivity:
https://www.linkedin.com/profile/profile-badges

Resources