This plug-in allows for a parameter to be added to the URL of a published Ceros Experience, which will drive a user to a specific anchor point within the Ceros piece.
How’d we do it?
We check the URL to see if it contains a specific parameter, and if it does, we comb the experience to identify any hotspots that have a matching SDK tag. We then fire a click event to the matching hotspots to trigger the scroll to action.
If your experience is standalone, in the Settings panel, paste the script below in the Custom HTML field:
If your experience is embedded, paste the script in the header of your parent page:
Pro Tip: This plugin works for other On Click interactions as well, not just scrolling to anchors or going to pages!
If you need to do something like show or hide an image, group or folder, or change the target state of an element in Ceros, you can simply use the interaction you need instead of an “On Click → Scroll to Position” interaction. Everything works the same way, the only difference is that you’re just using a different click interaction.
section=one
with the “one” being any number or word to identify your section.section=about
as this name will also be used as the parameter in your URL. For example http://view.ceros.com/developer-portal/deep-linking?section=about will scroll to the first anchor on the page, per our SDK setup.If you only have one page, or are linking to an anchor on Page 1, stop here. Do not add any more tags. Only a single section=something
tag is needed.
If you are linking to another page or a point on another page, proceed to Step 5.
section=one
. For this example, we’ll use section=contact
.On the first page of the experience, add a hotspot with four tags:
deep-link
: This tells the experience to use the deep-linking plugin.target-page=
: The target page is the number of the page where the section lives. Add the numeric page number after the equals sign (=
).target-section=contact
: The target section is the name of the section on the page.section=contact
: This is the name of the parameter added to the URL.The deep-linking plugin also allows you to link to anchors between pages in an experience. For example, you could have a hotspot on page 2 that links to an anchor on page 1.
Add a hotspot on an object that, when clicked, takes a user to a page with the anchor point you want them to be directed to. Use the SDK tool, you will need to add three tags:
deep-link
target-section=about
: The “about” value here is the section on the page you would like the user to be sent to.target-page=
?section=one
parameter (or whatever you tagged the hotspot with) to the end of your URL to test it out. It should automatically bring you to that section of the experience.