![]() I’d say an abundance of Custom HTML tags in a container is symptomatic of one (or more) of the following things: Great question! And one I don’t have a hard-and-fast answer for. Why use Custom HTML tags? Why use a tag management solution for element injection? Yes, I do recognize the irony of such a disclaimer on this particular article. We’ll get to this in the summary, but just to foreshadow the conclusion:Īvoid using Custom HTML tags unless it’s absolutely necessary. Each element you add compounds to the problem, and on single-page apps which might not reset the DOM between transitions, you could end up with hundreds of injected elements on the page, each hurting the performance in exponential increments. Basically, the browser has to calculate again dimensions, positioning, layouts, and attributes of elements preceding, surrounding, and nested within the injected element. ![]() One extremely important thing to keep in mind is that when you add a new element to the page you force a reflow of the content. Typically, this translates to: “The bottom of the page”, but this is not a given with today’s fluid layouts. Now, what this essentially means is that anything you type into a Custom HTML tag is added to the end of body, whatever that is at the time of injection. There are some nuances to this process, such as how Google Tag Manager handles the onHtmlSuccess and onHtmlFailure callbacks in tag sequencing, and how elements are stripped of all custom attributes before injection.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |