Web AppBuilder for ArcGIS (WAB) widgets enabling Maptiks map analytics on maps authored in ArcGIS Online and embedded in WAB apps.
A Web Appbuilder for ArcGIS widget that enables Maptiks analytics on map.
- Sign up for a Maptiks account.
- Download, install, and start Web AppBuilder for ArcGIS (Developer Edition)
- Create a new app or import an existing app.
- Download MaptiksWidget and copy into the
widgets
folder in either:
-
the WAB:
{path/to/WAB}/client/stemapp/widgets
-
an individual app:
{path/to/WAB}/server/apps/{appid}/widgets
Note that the widgets folder automatically re-populates each time the theme of the app is changed. If you change the theme of the app after updating the widgets folder, it will be overwritten, and this modification will be lost.
- Register MaptiksWidget as an off-panel widget in the
widgets
object in either:
-
the WAB:
{path/to/WAB}/client/stemapp/predefined-apps/default/config.json
-
an individual app:
{path/to/WAB}/server/apps/{appid}/config.json
Note that widgets are associated with the theme in the config file - the default theme if added to the WAB file, or the current theme if added to the app file. If you change the theme of the app after updating the config file, it will be overwritten, and this modification will be lost.
"widgetsOnScreen": {
"widgets": [
...
{
"uri": "widgets/MaptiksWidget/Widget"
},
...
]
...
}
- Obtain a trackcode for your domain from your Maptiks account, and choose an ID that will appear in the list of tracked maps in your Maptiks account.
- In WAB, configure the app. Depending on which app template/theme you use, the widget may or may not appear in the configuration UI.
- If you use the
Default (2D)
template, the MaptiksWidget should appear in the available widgets. Configure the widget with the Maptiks trackcode and ID. - Templates such as
Infographic
,Ground Zero
,Editor
, andMaplet
, as well as various themes, do not show available custom widgets in the UI. To enable Maptiks on these templates, enter the Maptiks trackcode and ID in the widget config file:{path/to/WAB}/server/apps/{appid}/widgets/MaptiksWidget/config.json
:
{
"maptiksTrackcode": "your Maptiks trackcode",
"maptiksId": "ID of your choice"
}
- Save the changes.
- Deploy your app.
This method is not officially supported by Esri, nor by extension, Maptiks, and should be used with discretion.
- Sign up for a Maptiks account.
- Create an app in the ArcGIS Online version of WAB.
- Once complete, download the app as a zip folder from the app item page. Unzip the app.
- Download MaptiksWidget and copy into the app's
widgets
folder. - Obtain a trackcode for your domain from your Maptiks account, and choose an ID that will appear in the list of tracked maps in your Maptiks account.
- Open the app's
config.json
file in a text editor. There is a section in the file that lists the app's widgets. The list starts with"widgetOnScreen":{"widgets":[
. We need to include the following information in that list (make sure to substitute your trackcode and ID). We recommend adding the widget to the end of the list. It should look like this:
"widgetOnScreen":{"widgets":[
... existing widgets,
{
"uri": "widgets/MaptiksWidget/Widget",
"id": "widgets_MaptiksWidget_Widget",
"IsController": false,
"openAtStart": true,
"name": "MaptiksWidget",
"version": "0.0.1",
"config": {
"maptiksTrackcode": "your Maptiks trackcode",
"maptiksId": "ID of your choice"
},
"position": {
"relativeTo": "map"
}
}
]}
- Save the changes.
- Deploy your app.