I’m hoping someone can lend some custom widget guidance
We are building a “Refer a Friend” program. I have a page in CM1 with an embedded Marketo form. On submit, the page directs to a new page with the form values as URL parameters. We are trying to use these URL parameters to build a unique URL for the member to forward to friends and family. The URL with all the required parameters is reeeeally long, and I want to use bitly to shorten it.
Our web server is Windows and our apps run on .net. I haven’t successfully integrated any .net apps with CM1 though, I’m confused with how to integrate all of the parts in a project.
I’d love to do straight Js, but that exposes our access token, so it is not an option. I’m wondering if a custom widget might work? Would storing the authentication token info as an asset, or coding it into the widget, hide the token from the user?
Following best practices you’d want to have some server side code handling the authentication token in order keep that out of the client browser.
One solution would be to write the majority of the application in JavaScript within Percussion as a custom widget and make a call to an ASP script on your application server in order to process the bit.ly URL shortening part securely. The JavaScript call can send over the long URL for processing and the ASP script would return the shortened URL.
If Percussion is publishing to a webserver that’s running the .NET framework then you can embed .NET code directly into Percussion pages by placing the code into HTML widgets on the page and wrapping the code in [—code—] tags.