Get metatag with data element | Community
Skip to main content
August 28, 2020
Solved

Get metatag with data element

  • August 28, 2020
  • 2 replies
  • 1602 views

Hi

 

I think this post is related to Analytics & Launch

 

Let's say the following HTML code : <meta name='mymeta' content='myvalue' />

 

We try to have a report/workspace in Analytics with only pages where mymeta is not empty.

 

For the workspace it's ok but how can I store/log somewhere that a page has this meta ?

 

Data element + rules ?? If yes how ? where can I find examples ?

 

Thank you in advance.

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Brian_Johnson_

Hi, @renow 

In Launch, I'd recommend creating a data element that scrapes the meta tag from the page, then reference the data element in the necessary rules. For example, with the meta tag from your question (<meta name='mymeta' content='myvalue' />), create the following data element:

  • Name: mymeta
  • Extension: Core
  • Data Element Type: DOM Attribute
  • CSS Selector (right panel): meta[name='mymeta']
  • Use value of: Other Attribute: content

In your rules, you can reference the data element (%mymeta%) to populate props/eVars, send to GA, or any other endpoint you need.

2 replies

Brian_Johnson_
Brian_Johnson_Accepted solution
Level 8
August 28, 2020

Hi, @renow 

In Launch, I'd recommend creating a data element that scrapes the meta tag from the page, then reference the data element in the necessary rules. For example, with the meta tag from your question (<meta name='mymeta' content='myvalue' />), create the following data element:

  • Name: mymeta
  • Extension: Core
  • Data Element Type: DOM Attribute
  • CSS Selector (right panel): meta[name='mymeta']
  • Use value of: Other Attribute: content

In your rules, you can reference the data element (%mymeta%) to populate props/eVars, send to GA, or any other endpoint you need.

jantzen_b
Adobe Employee
Adobe Employee
September 16, 2020
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?