Generate tags for snippets to use in html

Generate tags for snippets to use in html

It would be great if I could create snippets and then have it generate a tag that I can use in templates or other html documents. 

For example, right now with forms, you can get a form script tag that you can then paste into basically any html document to have the form show up on that page. 

A simple use-case would be standard company boilerplate at the bottom of a landing page. Right now, if you use the drag and drop landing page builder you can drag a snippet onto a page. This is nice, but sometimes the drag and drop interface isn't powerful enough and I have to dive into the html, but I can't insert snippets in html. 

It would be nice to have the flexibility to create a snippet, name it and insert it in any html file (managed in Marketo). The tag could be a simple token, maybe something like {{snippet.Boilerplate}} or for more advanced integration it could be like the script tags for forms. 


8 Comments
Anonymous
Not applicable
Andrew, I'm not sure I follow, are you looking for an API to push Snippets and/or tags into Marketo? Or something else?
Andrew_Sielen1
Level 3
Hey Erik, 

I kind of see two different options. One as a fill fledged API similar to the form 2.0 API and one that is more just like global tokens. 


How I see each option working
For the first options (full API). 
  1. Create a snippet in Marketo design studio
  2. After you create the snippet, you can then go to the Snippet actions menu (or right click in the navigation pane) and select a new menu option "Embed Code"
  3. You can then use this Embed Code anywhere (inside or outside of Marketo) to use your snippet anywhere (Embed Code would be something like
    <script src="//app-abb.marketo.com/js/forms2/js/snippets.js"></script>
    <form id="mktoSnippet_1270"></form>
    <script>MktoSnippets.loadSnippet("//app-abb.marketo.com", "000-AAA-000", 1270);

     
The second option (Global Token)
  1. Create a snippet in Marketo design studio
  2. After you create the snippet, you can then go to the Snippet actions menu (or right click in the navigation pane) and select a new menu option "Get Token" (or create Token, or something similar)
  3. This will create a token that you can use ONLY in Marketo. The oken could be something like:
    {{snippet.My Snippet}}
  4. This would essentially be like a global token, where you can insert that token anywhere *within* Marketo
The reason the current snippet functionality doesn't suit my needs is because snippets can only be inserted in the visual editors not through edition html. 
Anonymous
Not applicable
Does it need to be a snippet, or if you had a global rich text token would that work?
Andrew_Sielen1
Level 3
That would be fine. Is that already a feature?

I just figured snippets so they would be easy to manage. 
Anonymous
Not applicable
Sort of.

You can make My Tokens in Folders, so if you have all of these under a parent folder, you could make tokens there and use them.

I was also asking because we've considered global tokens before and wanted to know if that would also work.
Andrew_Sielen1
Level 3
Global [rich text/plain text] tokens would work. 

The folder token solution would work for now, but it feels a bit like a workaround. 

Thanks for taking the time to look at this!
Andrew_Sielen1
Level 3
Just thought of another use of a global token system. 

It could be used as a sort of light template system. 

In most web frameworks, you can build out html templates piece by piece. So you can build a header template and then include that template across all pages. 

A global token system could be used similarly. For example, we could put all our tracking scripts in one token and then include that token in all our landing page templates so if anything changes we only have to change it in one location. 
kh-lschutte
Community Manager
Status changed to: Open Ideas