Expand my Community achievements bar.

SOLVED

Get metatag with data element

Avatar

Level 1

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.

 

1 Accepted Solution

Avatar

Correct answer by
Level 8

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

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.

Avatar

Level 10
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?