Need Ability To Dynamically Populate Tracking Script In "Bubble Settings"

I have a tracking script that is supposed to go on every page in the body but it has information on the user in it that should be getting passed to the server.

How can I dynamically change the content in the Bubble Settings site-wide scripts section?

1 Like

Would it work if you put it into the head instead of the body? You can insert dynamic data in the head on the page property editor.

1000’s of pages is the concern…

It seems natural that the “settings” code section would also allow for dynamic fields/content.

Or, maybe place it into the footer in a reusable element?

Well it’s the “setting SEO” script section, but I get your point.

That was going to be my next suggestion - try opening up the code with the html element and keeping it hidden? I have no idea if that would work though, it’s just a guess

How can you add a page level script before the /body tag?

All i see is HTML header?

Either that, or allow us to edit the site-wide script dynamically in settings.

Did you try adding the snippet anyway? I was able to pull in a JS library through a CDN on the SEO settings and page html header, although for my specific objective I never ended up getting the library working properly.

Bubble won’t allow access to the whole page’s code, it’s not how bubble is designed to work. That said, I don’t think it’d hurt to reach out to J&E and see if they won’t add the snippet you might need. I dunno if today would be the best timing though - I’m pretty sure they’ve been working all weekend on some infrastructure change and I’m guessing from some of the buzz this morning they’re still at it.

I haven’t tried yet… but it seems that we need to be able to add dynamic code also to the Settings code injection vs. at the page level. I hope that we can get a reply from @Bubble on this as it would really help me track site-wide vs. having to manually inject the code on possibly hundreds of pages.

Can you summarize the question? It’s easier to answer than reacting to a multi-post conversation.

IMHO you would need to add the tracking script manually to each page.

I dont think you would have 1000s of bubble pages, but rather dynamic pages. For example under /post/blogpostname /post/ would be the page you woould add the tracking code to.

Just add the base code to the global body and call the tracking events from a custom HTML element.
Be careful, I think these HTML elements reload on resize / responsive and on dynamic data change, so that may emit multiple events and thus create Vanity statistics for you.

@emmanuel we need to be able to dynamically edit the tracking codes in the settings screen as well:

Why not just doing this at the page level, and have the code use the current page thing? if you have the code there you’re all set.

So many pages is the concern…

Plus, in another request to you, I’m trying to dynamically create pages as a list of Things changes/added too/deleted (that all need this tracking code on it) and also expose those pages in the sitemap for SEO.

If we could edit inside the Settings screen like we can on-page then we would be all good for sitewide activity tracking that passes specific data based on the user currently logged in.

Well if all pages have the same type, it’s really one page, and it’s easy. Otherwise no, we can’t do this, as at the setting level there is no dynamic context (like a page thing).

If I may, if you have so many pages, that probably means you have an issue with your design. Facebook doesn’t have 1.2 billion pages, they have one, the profile page, and 1.2 billions users / things.

Ok so page can be set Thing (Airport Codes) but will they output in the sitemap so that it can be submitted to Google? And as data changes in the db and new airports are added it should automatically add to the sitemap.

Sitemap is a different question, that’s something we can talk about sponsoring wise, but it is a major project not a quick one.

And keep in mind it’s not because you have a sitemap that google ranks you well, it’s because you have content that users point to. So a sitemap helps, but it’s not a miracle.

I agree completely. Just need a way to tell google where these pages are so that they are indexed. That requires a specific url to that page and an XML feed containing a list of all those URL’s.

How can I get a specific URL that is accessible to anyone dynamically based on a list of changing Things and connect it to an XML feed? Maybe that will work in liex of the sitemap issue.

We don’t support this yet. That’s why it’s a feature request, and not a small one.

At the end of the day, if users point to your pages, they’ll be indexed. If you google “using a repeating group bubble” a Bubble documentation, which is a bubble page with a thing, comes first.

You can configure a lot to do with your site in the Google Search Console in the webmaster tools.