Get metatag with data element

Avatar

Avatar

renow

Avatar

renow

renow

28-08-2020

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.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

evolytics_brian

Avatar

evolytics_brian

evolytics_brian

28-08-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.

Answers (0)