I have built a widget that other users can embed in their sites as an iframe. I have included Google Analytics inside the widget, so that I can tell when other users are embedding it.

My setup is that each widget has an ID, and I record the ID as a page view.

This works fine - when there is just one iframe in a page.

However, I've noticed that if a user puts multiple copies of my widget (with different IDs) in their page, only the last widget in the page records a page view. The other widgets are not recorded at all.

  1. Why is this? I suspect that it may be something to do with Analytics only setting one cookie for my domain?

  2. Is there anything I can do about it? I'd like to know each time each widget is embedded, whether on the same page or not.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.