> You'll need to add more information. what does "track existing cookies" mean? Track where? What does "make them show" mean? Make them show...where?
Like, the moment a website loads - some cookies are stored, right? Well, I want to see what those are. In firefox I can use Tools > Web Developer > Storage Inspector to see them (_ga, _gid, etc). Now, in the guide I linked in the post it is explained that GTM allows me to prevent those cookies from being stored prior to user consent (as in when clicking on an "accept cookie policy" button), but that means GTM needs to detect those cookies first, right? For example look at this IMAGE taken from the guide. But the guide doesn't explain how to set up GTM to have those things be as shown in the image/guide. This is what I need to know.
​
> If you simply want to know what (first-party) cookies are written in the user's browser, you can create a JavaScript Variable for global variable name document.cookie. It will return a string that has all the cookie configurations that have been set in first-party context on the user's browser for the current domain.
There is nothing simple about this to me. I only just learned about Google Tag Manager and set it up like a few days ago. I don't understand what you're explaining to me at all. No idea what a javascript variable is and all that ... string? ... That's why a lot of guides I find by googling myself just can't help me, and that's why I'm here asking in plain for explanation.
Just so I understand, are you firing an event within GTM that triggers after a user is on the page for 40 seconds?
Page and session durations in GA can be really counter-intuitive sometimes. There's a really great overview of this that Moz did a while back: https://moz.com/blog/how-do-sessions-work. Make sure to watch through the scenarios starting around 7 minutes into the video.
Basically, time on page is calculated by time / (views - exits). That sounds pretty straightforward but still has some very weird effects. If you have events firing on a page which GA sees it can increment the amount of time on the page. But if you then have the user exit on that page, it doesn't count as a pageview for the determination of avg time on page. This means that you can have a higher avg time on page higher than any individual session actually spent on the page, especially on pages that have high bounce or exit rates (which yours does).
So my best guess is that GA is seeing the event for the sessions where users are there for 40 seconds. It's adding that to the average time on page calculations. But then many of those users are exiting before another pageview and they don't contribute that pageview to the calculation. Again, the video does a very good job explaining a very confusing scenario.
The only tip I could offer would be to not put a whole lot of emphasis on time on page and avg session duration as hard metrics. Instead, focus on longer-term trends and changes in them (ignoring the one-time shift resulting from your new timer tag).
Hi
See the comments in this article (couple years old but still valid): https://moz.com/blog/heres-how-to-generate-and-insert-rel-canonical-with-google-tag-manager
In short, even though you CAN do it you probably SHOULDN’T. Google doesn’t guarantee crawling and indexing of GTM-originated metadata or canonicals, and other search engines seem to have even worse JS rendering capabilities.
So I wouldn’t add anything via GTM which should definitely be added in the page template.
Hi,
For future reference, if you know cross-posting is wrong (since you apologized for it), please don't do it.
As I wrote in Facebook, you'll need to show an example of the dataLayer.push()
command and elaborate a bit on how you mean to do the conditional. It's most likely not possible, or very brittle to do, but we can take a look.
To add an image to Reddit, you need to host it elsewhere, such as ImbBB or Imgur.
Simo
I'm working through that course right now. It's great.
Simo references this book by Jonathan Weber. (I was fortunate to take a GTM training that Jonathan led with Bounteous last year.) Unfortunately, the book is now four years out of date and I'm not sure how useful it would be given all of the changes to GTM in that span.