how to track clicks on outbound links on AMP container - google-analytics

I'm trying to create a tag that tracks clicks to external links from some of my pages. In the past I have never had problems in creating them on web container but now I have to create them for amp container and I am having many problems. Is it possible to get help?

You can use data-vars to get variable in GTAG-Manager via AMP like:
<a data-vars-youvarname="linkurl" href="linkurl>
and in GTAG-manager you can use the custom var {yourvarname}

Related

How to apply Google Analytics (GA4) tracking code to every page in a Bubble webapp?

I am using the official GA4 plugin for Bubble.io. However there is only one tracking code field per app, while an app might consist of multiple pages. From what I understood, tracking code is to be applied to every page of the application. How do I gather data from each of the pages then? Thanks!
If you want to add a tracker to every page, within your app, navigate to Settings -> SEO/metatags and scroll down to Script/metatags in Header or Script in body to add your tracking snippet.

Custom dimension on product pages from h1 using GTM - what's the best tagging strategy for the tag to only fire on the product pages?

I'm able to get the product tag to fire, extract the product name from h1 and pass it onto as a custom dimension.
However, as it's a different tag from the main page views tag - I would get duplicate page views.
What would be the best strategy in tagging the custom dimensions?
Would creating an exception so the main page views tag don't run on the product pages and then creating that product page tag that only runs on product pages be acceptable?
I would recommend that you add the payload data to a non-interaction event instead. This way, you do not inflate your page view numbers.
But - if you want to add this information to the page itself, then you'd need to set it up as a page view. It all depends on what you want to achieve.
Otherwise, I'd write a JS snippet that just checks the URL and then decides what to fire. Or, use a hit- or eventCallback. Many different ways to solve a problem!

How do I integrate two separate Google Analytics accounts such that one account tracks a subpage of the main page that the other account tracks?

Another person has a google analytics watch on a page and all the first level subpages, however the page I want to track is a subpage of a subpage (second level). How do I apply my tracking code to collect information on the page I want without interfering with the other account's data collection? Working in drupal 7.
You should be able to add multiple instances of analytics.js GA tracking code:
https://support.google.com/analytics/answer/1032400?hl=en
You can create static blocks out of GA embeds and use block properties to set on what page what block should appear or use some advanced module, like context to fine tune appearing of that block.
Or you can place the code into html template directly and use good old (and ugly) if condition to show embed code only to some pages.

Manually assigning page META tags to asp.net dynamic pages

I just first want to say, thanks for taking the time to read this!
I have an e-commerce website running the content management system DotNetNuke, which I believe is built on the asp.net platform in a windows server environment. The specific module that powers my e-commerce store dynamically generates pages for each of the store categories, as a user browses through the products available. As you may be aware, modules such as these must be placed on a specific page, and all the dynamic content generated by the module must reside on that "parent page".
The problem is that while the module does allow me to add HTML text for H1's and H2's on these dynamic pages, it does not support adding page meta tags such as "title" and "description". As a result, all of the dynamic pages generated by the module pull their meta tags from the parent page, making it difficult for Google to understand what I'm trying to show the user. This also causes google to show all these generated pages as having "duplicate title tags" in my analytics.
The temporary fix:
I have removed the title tags from all of these "parent pages", in hopes that google will decide to generate it's snippits from the H1 and H2 tags residing on the dynamic pages. Was this wise?
Now for the question:
Is there any kind of solution available which would allow me to manually assign meta tags to a page I specify in my hosting environment? As I stated earlier, I am able to add body HTML code to pages. Is there any way to force a page title tag from code placed in the body? Is there a better way to do this? You can view my problem in action at www.yandasmusic.com
Thanks for your time and patience!
Alex
The temporary fix: I have removed the title tags from all of these "parent pages", in hopes that google will decide to generate it's snippits from the H1 and H2 tags residing on the dynamic pages. Was this wise?
Blockquote
No, not particularly wise. The page title is important.
The first route you should take is speaking to the module developer. They should know about replacing page meta information on a per-product basis.
You can get (limited) results by varying the page title/description using javascript when the page loads. Just keep the js simple and use the DOM information already on the page (ie, read the product name).
I posted a blog about this recently : http://www.ifinity.com.au/2012/10/04/Changing_a_Page_Title_with_Javascript_to_update_a_Google_SERP_Entry
The javascript fix will probably work if you set it up correct. But you really need to convince the module developer to change the way the module works, as bdukes has posted.
Don't bother with the Meta Tags - none of the search engines really read/use them because they are so easily spoofed. Just concentrate on the title and description of the page.
Ideally, your store module should be setting the page title and other meta information. In DotNetNuke, you can access the Title, MetaDescription, and MetaKeywords of the page by casting Page the DotNetNuke.Framework.CDefault type. If the store module doesn't provide this, you should ask the developer to add the functionality.

Drupal arguments in a menu

By default on a page I have the following menu:
Profile /profile
Albums /album
Awards /awards
Going to any of those pages will load the page default.
If I go to a page on my site such as /mycontent/1 I wish to change a the menu to be the following.
Profile /profile/1
Albums /album/1
Awards /awards/1
I want to pass the argument (nid) to the menu. Is this possible?
Update
The selected answer does do what I asked. I however have changed how I am doing things to use Panels to display the content. I am then using some CSS and JavaScript to hide and show content. With views caching it seems to be working well.
Yes,use arg(0),arg(1), or arg(2) depending on which variable you want to use. It will use the path like the indexes of an array (0/1/2/3/4/etc...). Drupal will send you these variables as they were before the path was aliased if that is something that has been applied to it. Why are you passing the variable? There is probably a better way to do it the "Drupal" way..
Actually I am working on this same problem currently where I need to translate an aliased path: dept/profile/1 to load node/1223/profile/1 where 1 is the ID of the profile to show.
What I am using now is the URL Alter module and implementing the hook it gives to enable this feature. If you are interested in this maybe we can see if it is possible to get module out with a GUI.
My thread on this that is active now: Using module: url_alter and it's hook: hook_url_outbound_alter()
I am using a node that houses a panel which has a view inside it, for reasons that are site specific.

Resources