SOLVED

Question: how to read webpage tags and use them in triggers (non-marketo webpages)

Go to solution
NadineThomas
Level 2

Question: how to read webpage tags and use them in triggers (non-marketo webpages)

We have solution tags in the backend of our webpages - every page is tagged with a solution area. Now we want to use these tags for our interest scoring/solution scoring.

 

Example: I visit the webpage example.com/how-to-forecast with a tag in the backend: analytics.

 

I want marketo to read the tag: analytics and give +5 points on interest score: analytics.

 

Our webdevelopers don’t want to add these tags in the url as part of the slug - reason: keep them clean and user-friendly.

 

What are the best practices to achieve this? How do we push the tags to marketo when someone is visiting the page? (must be usable in trigger). Any tips much appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Question: how to read webpage tags and use them in triggers (non-marketo webpages)


We think using a custom endpoint for this would be the best. It takes us no time to set it up and it keeps the HTML pages lean and clean. However, we wonder what's the best practice in this case.

That sounds like the worst choice by far! It also doesn’t really keep the page “lean” because you need JS to fetch the data. And you need to maintain a whole other service to get data the page already knows about itself. Really the last thing I would do.

 

The most appropriate place would be a <meta> tag. I’ve used <meta name="collection"> for this.

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Question: how to read webpage tags and use them in triggers (non-marketo webpages)

Yes, you can send a custom Munchkin Visit Web Page hit using the JS API. But can’t give further guidance until you give an actual example of how the tags are embedded in the page.

NadineThomas
Level 2

Re: Question: how to read webpage tags and use them in triggers (non-marketo webpages)

Thanks for your quick reply Sanford, and already thanks in advance for helping out - I assumed if anyone would answer this, it's probably you. 🙂 

 
Using JS API for this sounds great. We have total control over how these tags should be embedded in the page. We can use:
  • a REST API call from a script to a custom endpoint on our server to get these tags
  • body data attributes, example: <body data-solutions="analytics, planning" ...
  • inlined in the HTML  js variables, example: let mySolutions = "analytics, planning"
  • inlined in the HTML window variables, example: window.mySolutions  = "analytics, planning"
  • etc.
We think using a custom endpoint for this would be the best. It takes us no time to set it up and it keeps the HTML pages lean and clean. However, we wonder what's the best practice in this case.
SanfordWhiteman
Level 10 - Community Moderator

Re: Question: how to read webpage tags and use them in triggers (non-marketo webpages)


We think using a custom endpoint for this would be the best. It takes us no time to set it up and it keeps the HTML pages lean and clean. However, we wonder what's the best practice in this case.

That sounds like the worst choice by far! It also doesn’t really keep the page “lean” because you need JS to fetch the data. And you need to maintain a whole other service to get data the page already knows about itself. Really the last thing I would do.

 

The most appropriate place would be a <meta> tag. I’ve used <meta name="collection"> for this.

NadineThomas
Level 2

Re: Question: how to read webpage tags and use them in triggers (non-marketo webpages)

Ok, thanks a lot for your suggestion. Any chance that you could share how you send a custom Munchkin Visit Web Page hit using the JS API?

Darshil_Shah1
Level 10 - Community Advisor

Re: Question: how to read webpage tags and use them in triggers (non-marketo webpages)

This should help -- Munchkin Visit webpage