In a project, i am generating embeddable boxes with project logo and information, etc. And my customers take the code from their control panel and paste the code below to their websites. Logically same as Youtube 's embed function, only not video or iframe but an anchor tag.
When the script runs, i am injecting the generated styles and markup to the page.
So far like 20 of my customers use this functionality. My problem is, these links does not count as backlinks which isn’t very good for PageRank and SEO.
I’ve worked on a similar embedded system before, and used plain old hyperlinks and progressive enhancement so that it still worked when something went wrong and the JavaScript didn’t load or didn’t work properly (when you’re running scripts in other people’s pages you’ll encounter kinds of the weird edge cases).
It worked roughly like this:
We added a page to our site for each customer, which contained the same content we were embedding in their page (in our case, we were embedding a button which opened a lightbox, so we used a link to the lightbox content).
The customer added a link to our page in the place they wanted the embedded content to appear. The link had a class that identified it to our JavaScript.
The customer added some JavaScript at the bottom of their page. When the JavaScript ran it found the relevant links (using the class) and replaced them with the embedded content.
That should give you the back links you want, and a system that keeps on working when the customer has written some crazy JavaScript that stops your script from running.