03-08-2018 03:28 AM - edited 03-08-2018 03:29 AM
Thought I could use the Content Modification extension to add a simple <meta ...> tag to the list of other such tags in <head..>. Realised that there is no id= I can use to hook it on to. I don't do xPath, could that be used here and what should I then enter as Identifier??
Solved! Go to Solution.
03-09-2018 01:42 AM
Hi @per_lundqvist - I took a look, and the Content Modification extension will always insert a <div> (with your 'content' inside), so you won't be able to use it to insert a <meta> tag directly into the head as you're hoping.
I know it's not what you were asking for (and I'm sure you know how to do this), but it's pretty easy to insert a <meta> tag with JS:
var n = document.createElement('meta');
n.name = "test-meta-insertion";
var d = document.head;
05-25-2018 05:42 AM - last edited on 05-25-2018 05:51 AM by kathleen_jo
05-28-2018 12:47 AM
Hi @ErikDekker, if you put the snippet above into a JS extension with Pre Loader scope, a meta tag should be added the head, and that meta tag should also be picked up and added to the utag.data object on the page (works in my tests).
What are you seeing instead?
05-28-2018 03:03 AM
I looked in the sourcecode and didn't see the meta tag. When I look in the Tealium Tools I didn't see the extension loaded, but when I looked in the data > HTML metadata in the tealium Tools I saw the meta property. So it wasn't that obvious but I think it works now...
thnx for helping out,
05-28-2018 06:34 AM
Hi @ErikDekker, excellent - glad it's working!
In case it's interesting for you: It makes sense that it wouldn't show in the source code, since we're injecting it via JS after the source has loaded. But you should be able to see it in the 'Elements' tab of Developer Tools, since that view contains the info from the source as well as any dynamic changes that happen after page load. Any DOM changes in TiQ can be checked like that.