In previous posts, we've put together helpful guides to help you find out how to set up container tags and filters, how to set up Privacy Consent and CPA de-duplication, and even how to launch the Debug Console! Now, we’ve put together a combination of tips, tricks, shortcuts and advice in our Opentag best practice guide. And here it is:
1) Using Copy From and Copy To between accounts and development areas.
Testing tags before committing them to your live site is a must for all scenarios and we advise doing this by creating them in a separate Opentag container first. However this introduces the tedious task of copying code between your UAT and live sites. Thankfully there is an easier way! Opentag provides two handy functions for copying tags around; 'Copy To' and 'Copy From'.
The copy function allows you to copy whole containers or specific scripts from one container to another. You can also copy between multiple accounts if you have a different one for each domain you have. It saves so much time. Try it out!
2) Keep your containers tidy by de-duplicating filters.
If you have a lot of tags in each container, it is likely that you will end up using the same filter for multiple tags. You might need to set up filters so you only fire a tag on a confirmation page, for instance. By copying them across multiple tags, it makes your container very untidy, bloats the size of your Opentag account, and makes it harder to find and fix any bugs that come up.
One way to get around this is to create a dummy tag with the filter that you need, and then use it as a dependency tag. This works by having it fire in certain situations (e.g. reaching the confirmation page), and then setting up other tags to depend on this tag.
You can do this for all your filters, which will make your containers a lot tidier and your life a lot easier when re-using filters.
3) Ensure all variable names are meaningful
We might sound a bit like a stroppy parent telling you to keep your room tidy, but we’re going to do it anyway! If you are setting up a lot of tags, filters and everything else, it will make your life much easier in the long run if you make your custom variable names meaningful. An example: if you are serving a live chat tag that needs a specific account ID variable, then you should name it something along the lines of 'LiveChat_AccountID'. Then if you ever have to revisit or reuse your variables you can tell which tag the variable belongs to.
It’s so much better than just calling it “Account ID” or, heaven forbid, something like “ID”. When it comes to copying, fixing and even rebuilding certain technologies, you will be thankful that you gave it a meaningful name.
4) Create a bookmark for confirmation pages.
It can be very annoying if you’re testing tags on a confirmation page because to see the effects again, you have to go through the checkout process again… and again… and again.
To help our developers from this terrible fate, we’ve put together a little bookmark widget that you can use to re-inject Opentag into a page, without having to go through this endless process. It’s previously been top secret, but we’ve decided to let you in on the secret. Here is the code:
Drag this bookmarklet to your bookmarks bar, and any time you want to re-run Opentag you can just push it. Trust us, it will make your life so much easier!
You can also use the bookmarklet to inject a different Opentag container, e.g. you can run your UAT container on your live site to test your tags. Simply copy the two-part ID of the container into the popup box (e.g. 29385-83922) instead of leaving it blank.
We hope you find these tips and tricks useful. They’re real time savers that our team use almost every day. If you need to go back a few steps and check out some more of the basics, you can find help in our help center. Hopefully it will answer your questions, but if it doesn’t, you can always email firstname.lastname@example.org.